e_event_actoradd.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_actoradd.h"
00028 #include "../../../../../common/grid.h"
00029
00037 void CL_ActorAdd (const eventRegister_t *self, struct dbuffer *msg)
00038 {
00039 le_t *le;
00040 int entnum;
00041 int teamDefID;
00042
00043
00044 entnum = NET_ReadShort(msg);
00045 le = LE_Get(entnum);
00046 if (le) {
00047 Com_Printf("CL_ActorAdd: Actor with number %i already exists\n", entnum);
00048 return;
00049 }
00050 le = LE_Add(entnum);
00051
00052
00053 NET_ReadFormat(msg, self->formatString,
00054 &le->team, &teamDefID,
00055 &le->gender, &le->pnum, &le->pos,
00056 &le->state, &le->fieldSize);
00057
00058 if (teamDefID < 0 || teamDefID > csi.numTeamDefs)
00059 Com_Printf("CL_ActorAdd: Invalid teamDef index\n");
00060 else
00061 le->teamDef = &csi.teamDef[teamDefID];
00062
00063
00064
00065 le->type = ET_ACTORHIDDEN;
00066
00067 Grid_PosToVec(cl.mapData->map, le->fieldSize, le->pos, le->origin);
00068 le->invis = qtrue;
00069 }
00070