e_event_actorshoothidden.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 "e_event_actorshoothidden.h"
00027 
00028 int CL_ActorShootHiddenTime (const eventRegister_t *self, struct dbuffer *msg, const int dt)
00029 {
00030 #if 0
00031     int first;
00032     int objIdx;
00033     const objDef_t *obj;
00034     int weap_fds_idx, fd_idx;
00035 
00036     NET_ReadFormat(msg, self->formatString, &first, &objIdx, &weap_fds_idx, &fd_idx);
00037 
00038     obj = INVSH_GetItemByIDX(objIdx);
00039     if (first) {
00040         nextTime += 500;
00041         impactTime = shootTime = nextTime;
00042     } else {
00043         const fireDef_t *fd = FIRESH_GetFiredef(obj, weap_fds_idx, fd_idx);
00044         /* impact right away - we don't see it at all
00045          * bouncing is not needed here, too (we still don't see it) */
00046         impactTime = shootTime;
00047         nextTime = shootTime + 1400;
00048         if (fd->delayBetweenShots)
00049             shootTime += 1000 / fd->delayBetweenShots;
00050     }
00051 #else
00052     return cl.time;
00053 #endif
00054 }
00055 
00060 void CL_ActorShootHidden (const eventRegister_t *self, struct dbuffer *msg)
00061 {
00062     const fireDef_t *fd;
00063     int first;
00064     int objIdx;
00065     objDef_t *obj;
00066     weaponFireDefIndex_t weapFdsIdx;
00067     fireDefIndex_t fdIdx;
00068 
00069     NET_ReadFormat(msg, self->formatString, &first, &objIdx, &weapFdsIdx, &fdIdx);
00070 
00071     /* get the fire def */
00072     obj = INVSH_GetItemByIDX(objIdx);
00073     fd = FIRESH_GetFiredef(obj, weapFdsIdx, fdIdx);
00074 
00075     /* start the sound */
00076     if ((first || !fd->soundOnce) && fd->fireSound[0])
00077         S_StartLocalSample(fd->fireSound, SND_VOLUME_WEAPONS);
00078 }

Generated by  doxygen 1.6.2