e_event_particleappear.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 "../../../cl_particle.h"
00028 #include "e_event_particleappear.h"
00029
00037 void CL_ParticleAppear (const eventRegister_t *self, struct dbuffer *msg)
00038 {
00039 char particle[MAX_VAR];
00040 int entnum, levelflags;
00041 le_t* le;
00042
00043
00044 NET_ReadFormat(msg, self->formatString, &entnum, &levelflags, particle, sizeof(particle));
00045
00046 le = LE_Get(entnum);
00047 if (!le)
00048 LE_NotFoundError(entnum);
00049
00050
00051
00052 le->invis = !cl_leshowinvis->integer;
00053 le->levelflags = levelflags;
00054 le->particleID = Mem_PoolStrDup(particle, cl_genericPool, 0);
00055 le->ptl = CL_ParticleSpawn(le->particleID, le->levelflags, le->origin, NULL, NULL);
00056 if (!le->ptl)
00057 Com_Printf("Could not spawn particle: '%s'\n", le->particleID);
00058 }