Xonotic
ent_cs.qc File Reference
#include "ent_cs.qh"
+ Include dependency graph for ent_cs.qc:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEC_FACTOR   (360 / 32)
 
#define DEC_FACTOR   10
 
#define ENTCS_SET_MUTABLE_STRING(var, x)
 the engine player name strings are mutable! More...
 
#define ENTCS_SET_NORMAL(var, x)
 

Functions

 bool (entity ent, entity player) m_check
 
 ENTCS_PROP (ENTNUM, false, sv_entnum, sv_entnum, ENTCS_SET_NORMAL, {}, {}) ENTCS_PROP(ORIGIN
 
 ENTCS_PROP (MODEL, true, model, model, ENTCS_SET_NORMAL, { WriteString(chan, ent.model);}, { strcpy(ent.model, ReadString());}) ENTCS_PROP(SKIN
 
 ENTCS_PROP (CLIENTCOLORS, true, clientcolors, clientcolors, ENTCS_SET_NORMAL, { WriteByte(chan, ent.clientcolors);}, { ent.colormap=ReadByte();}) ENTCS_PROP(FRAGS
 
 ENTCS_PROP_CODED (ANGLES, false, angles_y, angles_y, ENTCS_SET_NORMAL, DEC_FACTOR, { WriteByte(chan, ent.angles.y/DEC_FACTOR);}, { vector v='0 0 0';v.y=ReadByte() *DEC_FACTOR;ent.angles=v;}) ENTCS_PROP_RESOURCE(HEALTH
 
 ENTCS_PROP_RESOURCE (ARMOR, false, RES_ARMOR, ENTCS_SET_NORMAL, DEC_FACTOR, { WriteByte(chan, bound(0, GetResource(ent, RES_ARMOR)/DEC_FACTOR, 255));}, { SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR);}) ENTCS_PROP(NAME
 
 setorigin (ent, v)
 
 STATIC_INIT (EntCSProps_renumber)
 
 STATIC_INIT (EntCSProps_setglobalids)
 
 void (entity ent, entity player) m_set
 
 void (int chan, entity ent) m_send
 
 void (entity ent) m_receive
 

Variables

 DEC_FACTOR
 
int ENTCS_PROP_ENTNUM_id = 0
 
int ENTCS_PROP_HEALTH_id = 0
 
int ENTCS_PROP_ORIGIN_id = 0
 
 ENTCS_SET_MUTABLE_STRING
 
 ENTCS_SET_NORMAL
 
 false
 
 frags
 
bool m_public
 
 netname
 
 origin
 
 RES_HEALTH
 
 skin
 
 true
 
vector v = ReadVector()
 

Macro Definition Documentation

◆ DEC_FACTOR [1/2]

#define DEC_FACTOR   (360 / 32)

Definition at line 118 of file ent_cs.qc.

◆ DEC_FACTOR [2/2]

#define DEC_FACTOR   10

Definition at line 118 of file ent_cs.qc.

◆ ENTCS_SET_MUTABLE_STRING

#define ENTCS_SET_MUTABLE_STRING (   var,
 
)
Value:
strcpy(var, x); \
MACRO_END
#define strcpy(this, s)
Definition: string.qh:49

the engine player name strings are mutable!

Definition at line 108 of file ent_cs.qc.

◆ ENTCS_SET_NORMAL

#define ENTCS_SET_NORMAL (   var,
 
)
Value:
MACRO_BEGIN \
var = x; \
MACRO_END

Definition at line 103 of file ent_cs.qc.

Function Documentation

◆ bool()

bool ( entity  ent,
entity  player 
)

◆ ENTCS_PROP() [1/3]

ENTCS_PROP ( ENTNUM  ,
false  ,
sv_entnum  ,
sv_entnum  ,
ENTCS_SET_NORMAL  ,
{}  ,
{}   
)

◆ ENTCS_PROP() [2/3]

ENTCS_PROP ( MODEL  ,
true  ,
model  ,
model  ,
ENTCS_SET_NORMAL  ,
{ WriteString(chan, ent.model);}  ,
{ strcpy(ent.model, ReadString());}   
)

◆ ENTCS_PROP() [3/3]

ENTCS_PROP ( CLIENTCOLORS  ,
true  ,
clientcolors  ,
clientcolors  ,
ENTCS_SET_NORMAL  ,
{ WriteByte(chan, ent.clientcolors);}  ,
{ ent.colormap=ReadByte();}   
)

◆ ENTCS_PROP_CODED()

ENTCS_PROP_CODED ( ANGLES  ,
false  ,
angles_y  ,
angles_y  ,
ENTCS_SET_NORMAL  ,
DEC_FACTOR  ,
{ WriteByte(chan, ent.angles.y/DEC_FACTOR);}  ,
{ vector v='0 0 0';v.y=ReadByte() *DEC_FACTOR;ent.angles=v;}   
)

◆ ENTCS_PROP_RESOURCE()

ENTCS_PROP_RESOURCE ( ARMOR  ,
false  ,
RES_ARMOR  ,
ENTCS_SET_NORMAL  ,
DEC_FACTOR  ,
{ WriteByte(chan, bound(0, GetResource(ent, RES_ARMOR)/DEC_FACTOR, 255));}  ,
{ SetResourceExplicit(ent, RES_ARMOR, ReadByte() *DEC_FACTOR);}   
)

◆ setorigin()

setorigin ( ent  ,
v   
)

Referenced by _Movetype_LinkEdict(), _StartItem(), antilag_restore(), antilag_takeback(), botframe_autowaypoints_fix_from(), buff_Respawn(), buff_SpawnReplacement(), buffs_BuffModel_Spawn(), CheatCommand(), CheatImpulse(), CL_SpawnWeaponentity(), ClientKill_TeamChange(), conveyor_think(), CopyBody(), cpicon_construct(), cpicon_draw(), CSQCPlayer_SetCamera(), ctf_CaptureShield_Spawn(), ctf_FlagSetup(), ctf_Handle_Pickup(), ctf_Handle_Retrieve(), ctf_Handle_Throw(), ctf_RespawnFlag(), Damage(), DamageText::DamageText_update(), DelayThink(), dom_controlpoint_setup(), dom_spawnpoint(), door_init_startopen(), door_reset(), DragBox_Think(), Draw_ShowNames_All(), DropBall(), FindConnectedComponent(), findtrajectorywithleading(), FireGrapplingHook(), generator_construct(), GENERIC_COMMAND(), GiveBall(), Ice_Think(), InterpolateOrigin_Do(), InterpolateOrigin_Undo(), Item_Create(), Item_InitializeLoot(), Item_Reset(), Item_Respawn(), Item_Show(), ItemDraw(), ka_DropEvent(), ka_RespawnBall(), ka_TouchEvent(), kh_Key_Attach(), kh_Key_Detach(), kh_Key_Think(), LocalCommand_debugmodel(), Monster_Dead_Fade(), monster_dropitem(), Monster_Reset(), Monster_Spawn(), movelib_groundalign4point(), MoveToRandomLocationWithinBounds(), Movetype_Physics_MatchTicrate(), Movetype_Physics_NoMatchServer(), Movetype_Physics_NoMatchTicrate(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), ons_camSetup(), ons_CaptureShield_Spawn(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Setup(), ons_generator_ray_spawn(), ons_GeneratorSetup(), ons_Teleport(), path_build(), pathlib_astar(), pathlib_mknode(), pathlib_walknode(), physical_item_damage(), physical_item_think(), physical_item_touch(), plat_reset(), PlayerTouchExplode(), Portal_FindSafeOrigin(), Portal_Spawn(), PutObserverInServer(), PutPlayerInServer(), RandomItems_ReplaceMapItem(), relocate_spawnpoint(), replace_with_insta_cells(), ResetBall(), sandbox_ObjectPort_Load(), sandbox_ObjectSpawn(), spawnfunc(), spawnmonster(), SpectateCopy(), SUB_CalcAngleMoveEnt(), SUB_CalcMove_controller_setbezier(), SUB_CalcMove_controller_setlinear(), SUB_CalcMoveDone(), sys_phys_simulate_simple(), TeleportPlayer(), train_next(), trigger_impulse_touch_radial(), trigger_push_findtarget(), trigger_push_test(), trigger_push_touch(), turret_construct(), turret_gibtoss(), UpdateAuxiliaryXhair(), UpdateChatBubble(), vehicle_initialize(), vehicle_tossgib(), vehicles_damage(), vehicles_projectile(), vehicles_setreturn(), vehicles_showwp(), vehicles_spawn(), viewmodel_draw(), W_AttachToShotorg(), W_Model(), W_Nexball_Attack2(), W_ThrowNewWeapon(), WarpZone_Projectile_Touch(), WarpZone_Teleport(), WarpZone_TeleportPlayer(), WarpZone_Touch(), WarpZone_TraceToss_ThroughZone(), WarpZoneLib_ExactTrigger_Init(), WarpZoneLib_MoveOutOfSolid(), WarpZoneLib_MoveOutOfSolid_Expand(), and waypoint_spawn().

+ Here is the caller graph for this function:

◆ STATIC_INIT() [1/2]

STATIC_INIT ( EntCSProps_renumber  )

Definition at line 19 of file ent_cs.qc.

References FOREACH.

19 { FOREACH(EntCSProps, true, it.m_id = i); }
#define FOREACH(list, cond, body)
Definition: iter.qh:19

◆ STATIC_INIT() [2/2]

STATIC_INIT ( EntCSProps_setglobalids  )

Definition at line 25 of file ent_cs.qc.

References BIT, CS(), entity(), FOREACH, and if().

26 {
27  FOREACH(EntCSProps, true, {
28  if (it.registered_id == "ENTCS_PROP_ENTNUM") ENTCS_PROP_ENTNUM_id = it.m_id;
29  if (it.registered_id == "ENTCS_PROP_ORIGIN") ENTCS_PROP_ORIGIN_id = it.m_id;
30  if (it.registered_id == "ENTCS_PROP_HEALTH") ENTCS_PROP_HEALTH_id = it.m_id;
31  });
32 }
int ENTCS_PROP_ENTNUM_id
Definition: ent_cs.qc:22
int ENTCS_PROP_ORIGIN_id
Definition: ent_cs.qc:23
if(IS_DEAD(this))
Definition: impulse.qc:92
int ENTCS_PROP_HEALTH_id
Definition: ent_cs.qc:24
#define FOREACH(list, cond, body)
Definition: iter.qh:19
+ Here is the call graph for this function:

◆ void() [1/3]

void ( entity  ent,
entity  player 
)

◆ void() [2/3]

void ( int  chan,
entity  ent 
)

◆ void() [3/3]

void ( entity  ent)

Variable Documentation

◆ DEC_FACTOR

DEC_FACTOR

Definition at line 126 of file ent_cs.qc.

◆ ENTCS_PROP_ENTNUM_id

int ENTCS_PROP_ENTNUM_id = 0

Definition at line 22 of file ent_cs.qc.

◆ ENTCS_PROP_HEALTH_id

int ENTCS_PROP_HEALTH_id = 0

Definition at line 24 of file ent_cs.qc.

◆ ENTCS_PROP_ORIGIN_id

int ENTCS_PROP_ORIGIN_id = 0

Definition at line 23 of file ent_cs.qc.

◆ ENTCS_SET_MUTABLE_STRING

ENTCS_SET_MUTABLE_STRING

Definition at line 135 of file ent_cs.qc.

◆ ENTCS_SET_NORMAL

ENTCS_SET_NORMAL

Definition at line 114 of file ent_cs.qc.

◆ false

false

Definition at line 114 of file ent_cs.qc.

◆ frags

◆ m_public

bool m_public

Definition at line 42 of file ent_cs.qc.

◆ netname

netname

Definition at line 135 of file ent_cs.qc.

◆ origin

origin

Definition at line 114 of file ent_cs.qc.

Referenced by _Movetype_CheckStuck(), _Movetype_CheckWater(), _Movetype_FlyMove(), _Movetype_LinkEdict(), _Movetype_NudgeOutOfSolid_PivotIsKnownGood(), _Movetype_Physics_ClientFrame(), _Movetype_Physics_Follow(), _Movetype_Physics_Frame(), _Movetype_Physics_Walk(), _Movetype_PushEntity(), _Movetype_PushEntityTrace(), _Movetype_PushMove(), _Movetype_TestEntityPosition(), _Movetype_UnstickEntity(), _StartItem(), a_think(), AuxiliaryXhair_Draw2D(), bot_aim(), bot_aimdir(), bot_cmd_aimtarget(), buff_Respawn(), CheatCommand(), CheatImpulse(), CheckWaterJump(), clientcamera_send(), ClientDisconnect(), conveyor_think(), CopyBody(), cpicon_construct(), cpicon_send(), CreatureFrame_FallDamage(), CSQCModel_Effects_Apply(), CSQCModel_Effects_PostUpdate(), CSQCModel_Hook_PreDraw(), CSQCPlayer_CalcRefdef(), CSQCPlayer_LOD_Apply(), CSQCPlayer_PredictTo(), CSQCPlayer_SavePrediction(), CSQCPlayer_Unpredict(), CSQCProjectile_SendEntity(), ctf_DelayedFlagSetup(), ctf_FlagThink(), DamageText::DamageText_draw2d(), debuggoalstack(), DelayThink(), dom_controlpoint_setup(), door_init_startopen(), door_reset(), Drag(), DragBox_Think(), Draw_ShowNames(), DropToFloor_Handler(), Ent_RemoveProjectile(), findnearest(), formatmessage(), generator_construct(), generator_draw(), generator_send(), GENERIC_COMMAND(), GrapplingHook_Stop(), GrapplingHookThink(), havocbot_ai(), havocbot_aim(), havocbot_bunnyhop(), havocbot_checkgoaldistance(), havocbot_chooseenemy(), havocbot_chooseweapon(), havocbot_dodge(), havocbot_goalrating_ast_targets(), havocbot_goalrating_kh(), havocbot_goalrating_ons_controlpoints_attack(), havocbot_goalrating_ons_generator_attack(), havocbot_keyboard_movement(), havocbot_moveto(), havocbot_movetogoal(), havocbot_role_ast_defense(), havocbot_role_ast_offense(), havocbot_role_ctf_carrier(), havocbot_role_ctf_defense(), havocbot_role_ctf_escort(), havocbot_role_ctf_middle(), havocbot_role_ctf_offense(), havocbot_role_ctf_retriever(), havocbot_role_dom(), havocbot_role_ft_freeing(), havocbot_role_ft_offense(), havocbot_role_generic(), havocbot_role_ka_carrier(), havocbot_role_ka_collector(), havocbot_role_ons_offense(), HUD_Radar(), Ice_Think(), IMPULSE(), InterpolateOrigin_Note(), IsFlying(), Item_PreDraw(), Item_Reset(), Item_Respawn(), Item_RespawnThink(), Item_Think(), ItemDraw(), ItemSend(), ItemUpdate(), ka_RespawnBall(), ka_TouchEvent(), kh_Key_Think(), LinkDoors(), Monster_Attack_Melee(), Monster_CalculateVelocity(), Monster_Dead(), Monster_Dead_Fade(), monster_makevectors(), Monster_Move(), Monster_Move_Target(), Monster_Remove(), Monster_Reset(), Monster_Spawn(), Monster_ValidTarget(), movelib_groundalign4point(), Movetype_Physics_MatchTicrate(), Movetype_Physics_NoMatchServer(), Movetype_Physics_NoMatchTicrate(), navigation_get_really_close_waypoint(), navigation_goalrating_end(), navigation_goalrating_timeout_can_be_anticipated(), navigation_poptouchedgoals(), navigation_routerating(), navigation_routetogoal(), navigation_shortenpath(), navigation_unstuck(), NET_HANDLE(), ok_DropItem(), ons_camSetup(), ons_CaptureShield_Spawn(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Think(), ons_DelayedGeneratorSetup(), PlayerDamage(), PlayerJump(), PlayerPreThink(), PlayerUseKey(), PM_check_hitground(), PM_check_slick(), PM_ClientMovement_UpdateStatus(), PM_Footsteps(), Projectile_Draw(), PutObserverInServer(), PutPlayerInServer(), relocate_nexball(), relocate_spawnpoint(), ResetBall(), respawn(), sandbox_ObjectEdit_Get(), sandbox_ObjectFunction_Touch(), sandbox_ObjectSpawn(), SendAuxiliaryXhair(), setItemGroup(), Spawn_Draw(), SpawnBall(), spawner_use(), spawnfunc(), SpawnPoint_Send(), spawnpoint_think(), steerlib_arrive(), steerlib_attract(), steerlib_attract2(), steerlib_beamsteer(), steerlib_dodge(), steerlib_flock(), steerlib_flock2d(), steerlib_repel(), steerlib_standoff(), steerlib_swarm(), steerlib_traceavoid(), steerlib_traceavoid_flat(), steerlib_wander(), SUB_CalcAngleMoveEnt(), SUB_CalcMove(), SUB_CalcMove_Bezier(), SUB_CalcMove_controller_think(), SUB_NoImpactCheck(), SV_OnEntityPreSpawnFunction(), sys_phys_simulate(), target_checkpoint_setup(), thrown_wep_think(), train_wait(), trigger_impulse_touch_radial(), trigger_push_findtarget(), turret_construct(), turret_die(), turret_draw(), turret_draw2d(), turret_gibboom(), vehicle_initialize(), vehicles_damage(), vehicles_findgoodexit(), vehicles_gib_explode(), vehicles_painframe(), vehicles_spawn(), viewmodel_animate(), viewmodel_draw(), WarpZone_Camera_camera_transform(), WarpZone_camera_transform(), WarpZone_Fade_PreDraw(), WarpZone_Projectile_Touch(), WarpZone_Touch(), WarpZoneLib_ExactTrigger_Init(), and waypoint_think().

◆ RES_HEALTH

RES_HEALTH

Definition at line 126 of file ent_cs.qc.

Referenced by _StartItem(), assault_decreaser_sprite_visible(), assault_objective_decrease_use(), assault_objective_reset(), assault_objective_use(), assault_wall_think(), basketball_touch(), bot_cmd_eval(), CheatCommand(), CheatImpulse(), ClientCommand_kill(), CommonCommand_editmob(), CopyBody(), cpicon_draw(), cpicon_send(), ctf_CheckFlagReturn(), ctf_FlagcarrierWaypoints(), ctf_FlagDamage(), ctf_FlagSetup(), ctf_FlagThink(), ctf_Handle_Drop(), ctf_Handle_Pickup(), ctf_RespawnFlag(), Damage(), destructible_heal(), dompointtouch(), door_damage(), door_go_down(), door_reset(), door_trigger_touch(), FireGrapplingHook(), FixIntermissionClient(), football_touch(), frag_centermessage_override(), Freeze(), freezetag_count_alive_players(), freezetag_LastPlayerForTeam(), ft_RemovePlayer(), generator_draw(), generator_send(), GENERIC_COMMAND(), GetResourceLimit(), GiveItems(), GiveResource(), GrapplingHook_Damage(), havocbot_goalrating_ctf_enemyflag(), havocbot_goalrating_enemyplayers(), havocbot_goalrating_ft_freeplayers(), havocbot_goalrating_item_can_be_left_to_teammate(), havocbot_movetogoal(), healtharmor_pickupevalfunc(), instagib_countdown(), Invasion_CheckWinner(), Item_GiveTo(), LinkDoors(), MapVote_Tick(), Monster_Attack_Leap_Check(), Monster_Damage(), Monster_Dead_Damage(), Monster_Dead_Fade(), Monster_Frozen_Think(), Monster_Heal(), Monster_Miniboss_Check(), Monster_Move_Target(), Monster_Reset(), Monster_Spawn_Setup(), Monster_Think(), Monster_ValidTarget(), MUTATOR_HOOKFUNCTION(), NET_HANDLE(), Obituary(), ons_ControlPoint_Icon_BuildThink(), ons_ControlPoint_Icon_Damage(), ons_ControlPoint_Icon_Heal(), ons_ControlPoint_Icon_Spawn(), ons_ControlPoint_Icon_Think(), ons_ControlPoint_UpdateSprite(), ons_GeneratorDamage(), ons_GeneratorHeal(), ons_GeneratorReset(), ons_GeneratorSetup(), Onslaught_count_generators(), plat_center_touch(), plat_outside_touch(), player_regen(), PlayerCorpseDamage(), PlayerDamage(), PlayerHeal(), PlayerHealth(), PlayerPostThink(), PlayerPreThink(), Portal_Damage(), Portal_Spawn(), Portal_TeleportPlayer(), powerups_DropItem(), powerups_DropItem_Think(), PutObserverInServer(), PutPlayerInServer(), spawnfunc(), SpectateCopy(), target_init_use(), target_objective_spawn_evalfunc(), test_weapons_hurt(), turret_construct(), turret_draw(), Unfreeze(), vehicles_damage(), vehicles_heal(), vehicles_painframe(), vehicles_projectile(), vehicles_projectile_damage(), vehicles_regen(), and W_WeaponFrame().

◆ skin

◆ true

true

Definition at line 135 of file ent_cs.qc.

◆ v

vector v = ReadVector()

Definition at line 116 of file ent_cs.qc.

Referenced by _MapInfo_Generate(), _MapInfo_Map_ApplyGametypeEx(), _Movetype_Physics_Follow(), aim_vec(), anglemods(), AnglesTransform_ApplyToAngles(), AnglesTransform_ApplyToVAngles(), AnglesTransform_FromAngles(), AnglesTransform_FromVAngles(), AnglesTransform_ToAngles(), AnglesTransform_ToVAngles(), anim_vec(), animdecide_setimplicitstate(), bot_aim(), bot_cmd_aimtarget(), botframe_updatedangerousobjects(), boxToGlobal(), boxToGlobalSize(), CategoryForEntry(), crosshair_getcolor(), CSQCModel_ApplyStairSmoothing(), CSQCPlayer_ApplyBobbing(), CSQCPlayer_ApplyChase(), CSQCPlayer_SetPredictionError(), cvar_changes_init(), cvar_or(), Damage(), damage_explosion_calcpush(), decompressShotOrigin(), draw_teamradar_icon(), draw_TextWidth(), drawBackground(), DrawCircleClippedPic(), expr_evaluate(), findtrajectorywithleading(), frexp(), GameCommand_gettaginfo(), GENERIC_COMMAND(), GetCurrentFov(), GetField_fullspawndata(), globalToBox(), globalToBoxSize(), GrapplingHookThink(), havocbot_chooseenemy(), havocbot_dodge(), havocbot_movetogoal(), HUD_Crosshair(), HUD_GetFontsize(), HUD_HealthArmor(), HUD_Scale(), HUD_Shift(), InitGameplayMode(), lgamma(), m_allocatetooltipbox(), minigame_hud_denormalize(), minigame_hud_denormalize_size(), minigame_hud_normalize(), Monster_Damage(), monster_makevectors(), navigation_findnearestwaypoint_withdist_except(), navigation_markroutes_checkwaypoint(), NET_HANDLE(), pathlib_expandnode_box(), PlayerCorpseDamage(), PlayerDamage(), PlayerEdgeDistance(), Portal_WillHitPlane(), prandomvec(), randompos(), RandomSelection_Add(), remquo(), Slider_mouseDrag(), solve_cubic_abcd(), solve_cubic_pq(), solve_quadratic(), SUB_CalcMove_controller_think(), TEST(), tgamma(), tracewalk(), trigger_push_touch(), vehicle_impulse(), vehicles_findgoodexit(), W_HitPlotUnnormalizedUntransform(), W_Model(), WeaponStats_ready(), XonoticColorpickerString_saveCvars(), XonoticCvarList_drawListBoxItem(), XonoticDecibelsSlider_loadCvars(), and XonoticServerInfoDialog_loadServerInfo().