25 #include "../../../../client.h"
26 #include "../../../cl_localentity.h"
27 #include "../../../../renderer/r_mesh.h"
28 #include "../../../../renderer/r_mesh_anim.h"
39 int objIdx, surfaceFlags;
40 int weap_fds_idx, fd_idx;
46 NET_ReadFormat(msg, self->formatString, &dummy, &dummy, &dummy, &objIdx, &weap_fds_idx, &fd_idx, &shootType, &flags,
47 &surfaceFlags, &muzzle, &impact, &dummy);
68 if (fd->
speed > 0.0) {
103 if (!weapon || !weapon->
def())
115 float modifiedMatrix[16];
143 int flags, normal, shooterEntnum, victimEntnum;
152 NET_ReadFormat(msg, self->formatString, &shooterEntnum, &victimEntnum, &first, &objIdx, &weapFdsIdx, &fdIdx, &shootType, &flags, &surfaceFlags, &muzzle, &impact, &normal);
156 leVictim =
LE_Get(victimEntnum);
210 Com_Error(
ERR_DROP,
"CL_ActorDoShoot: Invalid shootType given (entnum: %i, shootType: %i).\n", shootType, shooterEntnum);
Item * getLeftHandItem() const
void GLMatrixAssemble(const vec3_t origin, const vec3_t angles, float *matrix)
Builds an opengl translation and rotation matrix.
const char * LE_GetAnim(const char *anim, int right, int left, int state)
Get the correct animation for the given actor state and weapons.
this is a fire definition for our weapons/ammo
int CL_GetNextTime(const eventRegister_t *event, eventTiming_t *eventTiming, int nextTime)
void LE_AddProjectile(const fireDef_t *fd, int flags, const vec3_t muzzle, const vec3_t impact, int normal, le_t *leVictim)
const objDef_t * def(void) const
bool R_GetTagMatrix(const model_t *mod, const char *tagName, int frame, float matrix[16])
void CL_ActorDoShoot(const eventRegister_t *self, dbuffer *msg)
Shoot with weapon.
void NET_ReadFormat(dbuffer *buf, const char *format,...)
The user-friendly version of NET_ReadFormat that reads variable arguments from a buffer according to ...
bool S_LoadAndPlaySample(const char *s, const vec3_t origin, float attenuation, float volume)
does what the name implies in just one function to avoid exposing s_sample_t
bool CL_OutsideMap(const vec3_t position, const float delta)
Checks whether give position is still inside the map borders.
Defines all attributes of objects used in the inventory.
bool LE_IsActor(const le_t *le)
Checks whether the given le is a living actor.
void R_AnimChange(animState_t *as, const model_t *mod, const char *name)
Changes the animation for md2 models.
CL_ParseEvent timers and vars.
void Com_Error(int code, const char *fmt,...)
#define SKIP_LOCAL_ENTITY
#define IS_SHOT_RIGHT(x)
Determine whether the selected shoot type is for the item in the right hand, either shooting or react...
Item * getRightHandItem() const
item instance data, with linked list capability
const fireDef_t * FIRESH_GetFiredef(const objDef_t *obj, const weaponFireDefIndex_t weapFdsIdx, const fireDefIndex_t fdIdx)
Get the fire definitions for a given object.
model_t * modelPool[MAX_OBJDEFS]
int32_t shoot_types_t
Available shoot types - also see the ST_ constants.
le_t * LE_Get(int entnum)
Searches all local entities for the one with the searched entnum.
#define IS_SHOT_HEADGEAR(x)
Determine whether the selected shoot type is for the item in the headgear slot.
#define IS_SHOT_LEFT(x)
Determine whether the selected shoot type is for the item in the left hand, either shooting or reacti...
#define LE_IsSelected(le)
void Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
Struct that defines one particular event with all its callbacks and data.
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...
int32_t weaponFireDefIndex_t
void GLMatrixMultiply(const float a[16], const float b[16], float c[16])
Multiply 4*4 matrix by 4*4 matrix.
int R_GetTagIndexByName(const model_t *mod, const char *tagName)
Searches the tag data for the given name.
#define SND_VOLUME_WEAPONS
const objDef_t * INVSH_GetItemByIDX(int index)
Returns the item that belongs to the given index or nullptr if the index is invalid.
void R_AnimAppend(animState_t *as, const model_t *mod, const char *name)
Appends a new animation to the current running one.
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.
#define LE_NotFoundError(entnum)