e_event_actorrevitalised.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_actor.h"
00027 #include "../../../cl_hud.h"
00028 #include "../../../../renderer/r_mesh_anim.h"
00029 #include "e_event_actorrevitalised.h"
00030
00037 void CL_ActorRevitalised (const eventRegister_t *self, struct dbuffer *msg)
00038 {
00039 le_t *le, *floor;
00040 int entnum, state;
00041
00042 NET_ReadFormat(msg, self->formatString, &entnum, &state);
00043
00044
00045 le = LE_Get(entnum);
00046
00047 if (!le)
00048 LE_NotFoundError(entnum);
00049
00050 if (!LE_IsStunned(le) && !LE_IsLivingActor(le))
00051 Com_Error(ERR_DROP, "CL_ActorRevitalised: Can't revitalise, LE is not a dead or stunned actor");
00052
00053 LE_Lock(le);
00054
00055
00056 floor = LE_Find(ET_ITEM, le->pos);
00057 if (floor)
00058 FLOOR(le) = FLOOR(floor);
00059
00060 le->state = state;
00061
00062
00063 LE_SetThink(le, LET_StartIdle);
00064
00065
00066 if (le->team == cls.team) {
00067 const character_t *chr = CL_ActorGetChr(le);
00068 if (chr) {
00069 char tmpbuf[128];
00070 Com_sprintf(tmpbuf, lengthof(tmpbuf), _("%s was revitalised\n"), chr->name);
00071 HUD_DisplayMessage(tmpbuf);
00072 }
00073 } else {
00074 switch (le->team) {
00075 case (TEAM_CIVILIAN):
00076 HUD_DisplayMessage(_("A civilian was revitalised.\n"));
00077 break;
00078 case (TEAM_ALIEN):
00079 HUD_DisplayMessage(_("An alien was revitalised.\n"));
00080 break;
00081 case (TEAM_PHALANX):
00082 HUD_DisplayMessage(_("A soldier was revitalised.\n"));
00083 break;
00084 default:
00085 HUD_DisplayMessage(va(_("A member of team %i was revitalised.\n"), le->team));
00086 break;
00087 }
00088 }
00089
00090 VectorCopy(player_maxs, le->maxs);
00091
00092
00093 CL_ActorAddToTeamList(le);
00094
00095
00096 CL_ActorConditionalMoveCalc(selActor);
00097 LE_Unlock(le);
00098 }