UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
e_event_actorshoot.cpp File Reference

Go to the source code of this file.

Functions

int CL_ActorDoShootTime (const eventRegister_t *self, dbuffer *msg, eventTiming_t *eventTiming)
 Decides if following events should be delayed. If the projectile has a speed value assigned, the delay is relative to the distance the projectile flies. There are other fire definition related options that might delay the execution of further events. More...
 
static void CL_ActorGetMuzzle (const le_t *actor, vec3_t muzzle, shoot_types_t shootType)
 Calculates the muzzle for the current weapon the actor is shooting with. More...
 
void CL_ActorDoShoot (const eventRegister_t *self, dbuffer *msg)
 Shoot with weapon. More...
 

Function Documentation

int CL_ActorDoShootTime ( const eventRegister_t self,
dbuffer msg,
eventTiming_t eventTiming 
)

Decides if following events should be delayed. If the projectile has a speed value assigned, the delay is relative to the distance the projectile flies. There are other fire definition related options that might delay the execution of further events.

Definition at line 36 of file e_event_actorshoot.cpp.

References CL_GetNextTime(), CL_OutsideMap(), cls, fireDef_s::delayBetweenShots, FIRESH_GetFiredef(), eventTiming_s::impactTime, INVSH_GetItemByIDX(), client_static_s::isOurRound(), NET_ReadFormat(), eventTiming_s::nextTime, eventTiming_s::parsedDeath, SF_BOUNCED, eventTiming_s::shootTime, fireDef_s::speed, UNIT_SIZE, and VectorDist.

static void CL_ActorGetMuzzle ( const le_t actor,
vec3_t  muzzle,
shoot_types_t  shootType 
)
static

Calculates the muzzle for the current weapon the actor is shooting with.

Parameters
[in]actorThe actor that is shooting. Might not be nullptr
[out]muzzleThe muzzle vector to spawn the particle at. Might not be nullptr. This is not modified if there is no tag for the muzzle found for the weapon or item the actor has in the hand (also see the given shoot type)
[in]shootTypeThe shoot type to determine which tag of the actor should be used to resolve the world coordinates. Also used to determine which item (or better which hand) should be used to resolve the actor's item.

Definition at line 88 of file e_event_actorshoot.cpp.

References le_s::angles, le_s::as, cls, Com_Error(), Item::def(), ERR_DROP, animState_s::frame, le_s::getLeftHandItem(), le_s::getRightHandItem(), GLMatrixAssemble(), GLMatrixMultiply(), objDef_s::id, objDef_s::idx, IS_SHOT_RIGHT, le_s::model1, client_static_s::modelPool, model_s::name, le_s::origin, R_GetTagIndexByName(), and R_GetTagMatrix().

Referenced by CL_ActorDoShoot().