e_event_actorreactionfirechange.c

Go to the documentation of this file.
00001 
00005 /*
00006 Copyright (C) 2002-2010 UFO: Alien Invasion.
00007 
00008 This program is free software; you can redistribute it and/or
00009 modify it under the terms of the GNU General Public License
00010 as published by the Free Software Foundation; either version 2
00011 of the License, or (at your option) any later version.
00012 
00013 This program is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016 
00017 See the GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 */
00024 
00025 #include "../../../../client.h"
00026 #include "../../../../ui/ui_main.h"
00027 #include "../../../cl_localentity.h"
00028 #include "../../../cl_actor.h"
00029 #include "../../../cl_hud.h"
00030 #include "e_event_actorreactionfirechange.h"
00031 
00039 void CL_ActorReactionFireChange (const eventRegister_t *self, struct dbuffer *msg)
00040 {
00041     le_t *le;
00042     actorHands_t hand;
00043     int entnum, fmIdx, odIdx;
00044     character_t *chr;
00045     const objDef_t *od;
00046 
00047     NET_ReadFormat(msg, self->formatString, &entnum, &fmIdx, &hand, &odIdx);
00048 
00049     le = LE_Get(entnum);
00050     if (!le)
00051         LE_NotFoundError(entnum);
00052 
00053     chr = CL_ActorGetChr(le);
00054     if (!chr)
00055         return;
00056 
00057     if (odIdx != NONE)
00058         od = INVSH_GetItemByIDX(odIdx);
00059     else
00060         od = NULL;
00061 
00062     CL_ActorSetRFMode(chr, hand, fmIdx, od);
00063 
00064     /* Update display of firemode checkbuttons. */
00065     HUD_DisplayFiremodes(le, hand, qtrue);
00066 }

Generated by  doxygen 1.6.2