e_event_entappear.c
Go to the documentation of this file.00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include "../../../../client.h"
00026 #include "../../../cl_localentity.h"
00027 #include "e_event_entappear.h"
00028 #include "../../../../../common/grid.h"
00029
00036 void CL_EntAppear (const eventRegister_t *self, struct dbuffer *msg)
00037 {
00038 le_t *le;
00039 int entnum;
00040 entity_type_t type;
00041 pos3_t pos;
00042
00043 NET_ReadFormat(msg, self->formatString, &entnum, &type, &pos);
00044
00045
00046 le = LE_Get(entnum);
00047 if (!le) {
00048 le = LE_Add(entnum);
00049 } else {
00050 Com_DPrintf(DEBUG_CLIENT, "CL_EntAppear: Entity appearing already visible... overwriting the old one\n");
00051 le->inuse = qtrue;
00052 }
00053
00054 le->type = type;
00055
00056
00057
00058 if (le->type == ET_PARTICLE)
00059 le->invis = !cl_leshowinvis->integer;
00060
00061 VectorCopy(pos, le->pos);
00062 Grid_PosToVec(cl.mapData->map, le->fieldSize, le->pos, le->origin);
00063 }
00064