e_event_actorshoothidden.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 "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
00045
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
00072 obj = INVSH_GetItemByIDX(objIdx);
00073 fd = FIRESH_GetFiredef(obj, weapFdsIdx, fdIdx);
00074
00075
00076 if ((first || !fd->soundOnce) && fd->fireSound[0])
00077 S_StartLocalSample(fd->fireSound, SND_VOLUME_WEAPONS);
00078 }