Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
base.qh File Reference
#include <client/main.qh>
#include <common/util.qh>
#include <menu/draw.qh>
#include "events.qh"
Include dependency graph for base.qh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Callback
class  CallbackChain
class  CallbackChain::CallbackNode
class  Mutator

Macros

#define _MUTATOR_CALLBACK(name, func)
#define _MUTATOR_CALLHOOK(name, ...)
#define _MUTATOR_HANDLE_NOP(type, idx)
#define _MUTATOR_HANDLE_PARAMS(type, idx)
#define _MUTATOR_HANDLE_POPOUT(type, idx)
#define _MUTATOR_HANDLE_POPTMP(type, idx)
#define _MUTATOR_HANDLE_PREPARE(type, idx)
#define _MUTATOR_HANDLE_PUSHOUT(type, idx)
#define _MUTATOR_HANDLE_PUSHTMP(type, idx)
#define _MUTATOR_HOOKABLE(name, params)
#define _MUTATOR_IS_ENABLED(this)
#define _REGISTER_MUTATOR(id, dependence, cname)
#define EV_NO_ARGS(i, o)
#define EVAL_MUTATOR_HOOKFUNCTION(...)
#define M_ARGV(idx, type)
#define MUTATOR_ADD(name)
#define MUTATOR_CALLHOOK(name, ...)
#define MUTATOR_HOOK(cb, func, order)
#define MUTATOR_HOOKABLE(name, params)
#define MUTATOR_HOOKFUNCTION(...)
#define MUTATOR_HOOKFUNCTION_2(mut, cb)
#define MUTATOR_HOOKFUNCTION_3(mut, cb, order)
#define MUTATOR_IS_ENABLED(this)
#define MUTATOR_ONADD   if (mode == MUTATOR_ADDING)
#define MUTATOR_ONREMOVE   if (mode == MUTATOR_REMOVING)
#define MUTATOR_ONROLLBACK_OR_REMOVE   if (mode == MUTATOR_REMOVING || mode == MUTATOR_ROLLING_BACK)
#define MUTATOR_REMOVE(name)
#define MUTATOR_RETURNVALUE   CallbackChain_ReturnValue
#define MUTATOR_STATIC()
#define MUTATOR_TYPE_ARRAY(type, limit)
#define REGISTER_MUTATOR(...)
#define REGISTER_MUTATOR_2(id, dependence)
#define REGISTER_MUTATOR_3(id, dependence, cname)

Typedefs

using mutatorfunc_t = bool(int)

Enumerations

enum  { MUTATOR_REMOVING , MUTATOR_ADDING , MUTATOR_ROLLING_BACK }

Functions

void _mutPrintFail (string cb, string func)
bool Mutator_Add (Mutator mut)
void Mutator_Remove (Mutator mut)
bool Mutator_SendEntity (entity this, entity to, int sf)
 MUTATOR_TYPE_ARRAY (bool, 6)
 MUTATOR_TYPE_ARRAY (entity, 9)
 MUTATOR_TYPE_ARRAY (float, 11)
 MUTATOR_TYPE_ARRAY (int, 6)
 MUTATOR_TYPE_ARRAY (string, 5)
 MUTATOR_TYPE_ARRAY (vector, 7)
 NET_HANDLE (Mutator, bool isNew)
void NET_Mutator_Remove (entity this)
void RegisterCallbacks ()
void RegisterHooks ()
 STATIC_INIT (Mutators)
 STATIC_INIT_LATE (Mutators)

Variables

bool CallbackChain_ReturnValue
 read-only field of the current return value
const int CBC_ORDER_ANY = 4
const int CBC_ORDER_EXCLUSIVE = 3
const int CBC_ORDER_FIRST = 1
const int CBC_ORDER_LAST = 2
bool m_added
bool mutator_log = false

Macro Definition Documentation

◆ _MUTATOR_CALLBACK

#define _MUTATOR_CALLBACK ( name,
func )
Value:
Callback CB_##name; \
bool func(); \
{ \
CB_##name = NEW(Callback, func); \
}
void RegisterCallbacks()
Definition base.qh:166
#define ACCUMULATE
Definition _all.inc:31
string name
Definition menu.qh:30
#define NEW(cname,...)
Definition oo.qh:120

Definition at line 386 of file base.qh.

386#define _MUTATOR_CALLBACK(name, func) \
387 Callback CB_##name; \
388 bool func(); \
389 ACCUMULATE void RegisterCallbacks() \
390 { \
391 CB_##name = NEW(Callback, func); \
392 }

◆ _MUTATOR_CALLHOOK

#define _MUTATOR_CALLHOOK ( name,
... )
Value:
APPLY(__Mutator_Send_##name, 0 P99_IF_EMPTY(__VA_ARGS__)()(, __VA_ARGS__))
#define APPLY(f,...)
Definition functional.qh:28
#define P99_IF_EMPTY(...)
Definition p99.qh:31

Definition at line 188 of file base.qh.

◆ _MUTATOR_HANDLE_NOP

#define _MUTATOR_HANDLE_NOP ( type,
idx )

Definition at line 155 of file base.qh.

◆ _MUTATOR_HANDLE_PARAMS

#define _MUTATOR_HANDLE_PARAMS ( type,
idx )
Value:
, type in_MUTATOR_ARGV_##type##_##idx

Definition at line 156 of file base.qh.

◆ _MUTATOR_HANDLE_POPOUT

#define _MUTATOR_HANDLE_POPOUT ( type,
idx )
Value:
MUTATOR_ARGV_##type[idx] = out_MUTATOR_ARGV_##type##_##idx;

Definition at line 161 of file base.qh.

◆ _MUTATOR_HANDLE_POPTMP

#define _MUTATOR_HANDLE_POPTMP ( type,
idx )
Value:
MUTATOR_ARGV_##type[idx] = tmp_MUTATOR_ARGV_##type##_##idx;

Definition at line 160 of file base.qh.

◆ _MUTATOR_HANDLE_PREPARE

#define _MUTATOR_HANDLE_PREPARE ( type,
idx )
Value:
MUTATOR_ARGV_##type[idx] = in_MUTATOR_ARGV_##type##_##idx;

Definition at line 157 of file base.qh.

◆ _MUTATOR_HANDLE_PUSHOUT

#define _MUTATOR_HANDLE_PUSHOUT ( type,
idx )
Value:
type out_MUTATOR_ARGV_##type##_##idx = MUTATOR_ARGV_##type[idx];

Definition at line 159 of file base.qh.

◆ _MUTATOR_HANDLE_PUSHTMP

#define _MUTATOR_HANDLE_PUSHTMP ( type,
idx )
Value:
type tmp_MUTATOR_ARGV_##type##_##idx = MUTATOR_ARGV_##type[idx];

Definition at line 158 of file base.qh.

◆ _MUTATOR_HOOKABLE

#define _MUTATOR_HOOKABLE ( name,
params )
Value:
bool __Mutator_Send_##name(int params(_MUTATOR_HANDLE_PARAMS, _MUTATOR_HANDLE_NOP)) \
{ \
bool ret = CallbackChain_Call(HOOK_##name); \
return ret; \
} \
{ \
HOOK_##name = NEW(CallbackChain, #name); \
}
#define _MUTATOR_HANDLE_PUSHOUT(type, idx)
Definition base.qh:159
#define _MUTATOR_HANDLE_PARAMS(type, idx)
Definition base.qh:156
#define _MUTATOR_HANDLE_NOP(type, idx)
Definition base.qh:155
#define _MUTATOR_HANDLE_POPOUT(type, idx)
Definition base.qh:161
#define _MUTATOR_HANDLE_PREPARE(type, idx)
Definition base.qh:157
void RegisterHooks()
Definition base.qh:165
#define _MUTATOR_HANDLE_PUSHTMP(type, idx)
Definition base.qh:158
#define _MUTATOR_HANDLE_POPTMP(type, idx)
Definition base.qh:160
#define params(i, o)
Called when a client command is parsed NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return fa...
Definition events.qh:36

Definition at line 169 of file base.qh.

169#define _MUTATOR_HOOKABLE(name, params) \
170 CallbackChain HOOK_##name; \
171 bool __Mutator_Send_##name(int params(_MUTATOR_HANDLE_PARAMS, _MUTATOR_HANDLE_NOP)) \
172 { \
173 params(_MUTATOR_HANDLE_PUSHTMP, _MUTATOR_HANDLE_NOP) \
174 params(_MUTATOR_HANDLE_PREPARE, _MUTATOR_HANDLE_NOP) \
175 bool ret = CallbackChain_Call(HOOK_##name); \
176 params(_MUTATOR_HANDLE_NOP, _MUTATOR_HANDLE_PUSHOUT) \
177 params(_MUTATOR_HANDLE_POPTMP, _MUTATOR_HANDLE_NOP) \
178 params(_MUTATOR_HANDLE_NOP, _MUTATOR_HANDLE_POPOUT) \
179 return ret; \
180 } \
181 ACCUMULATE void RegisterHooks() \
182 { \
183 HOOK_##name = NEW(CallbackChain, #name); \
184 }

◆ _MUTATOR_IS_ENABLED

#define _MUTATOR_IS_ENABLED ( this)
Value:
this.mutatorcheck()

Definition at line 236 of file base.qh.

Referenced by STATIC_INIT_LATE().

◆ _REGISTER_MUTATOR

#define _REGISTER_MUTATOR ( id,
dependence,
cname )
Value:
bool MUTATORFUNC_##id##_hooks(int mode) \
{ \
return = false; \
} \
bool MUTATORFUNC_##id(int mode) \
{ \
return = false; \
bool ret = MUTATORFUNC_##id##_hooks(mode); \
if (ret) \
return ret; \
} \
bool MUTATOR_##id##_check() \
{ \
return dependence; \
} \
REGISTER(Mutators, MUTATOR, id, m_id, NEW(cname)) \
{ \
this.m_name = #id; \
this.mutatorfunc = MUTATORFUNC_##id; \
this.mutatorcheck = MUTATOR_##id##_check; \
} \
ACCUMULATE bool MUTATORFUNC_##id(int mode)
string m_name
Definition scores.qh:142
int m_id
Definition effect.qh:18

Definition at line 325 of file base.qh.

325#define _REGISTER_MUTATOR(id, dependence, cname) \
326 bool MUTATORFUNC_##id##_hooks(int mode) \
327 { \
328 return = false; \
329 } \
330 bool MUTATORFUNC_##id(int mode) \
331 { \
332 return = false; \
333 bool ret = MUTATORFUNC_##id##_hooks(mode); \
334 if (ret) \
335 return ret; \
336 } \
337 bool MUTATOR_##id##_check() \
338 { \
339 return dependence; \
340 } \
341 REGISTER(Mutators, MUTATOR, id, m_id, NEW(cname)) \
342 { \
343 this.m_name = #id; \
344 this.mutatorfunc = MUTATORFUNC_##id; \
345 this.mutatorcheck = MUTATOR_##id##_check; \
346 } \
347 ACCUMULATE bool MUTATORFUNC_##id(int mode)

◆ EV_NO_ARGS

◆ EVAL_MUTATOR_HOOKFUNCTION

#define EVAL_MUTATOR_HOOKFUNCTION ( ...)
Value:
__VA_ARGS__

Definition at line 396 of file base.qh.

◆ M_ARGV

#define M_ARGV ( idx,
type )
Value:
MUTATOR_ARGV_##type[idx]

Definition at line 153 of file base.qh.

Referenced by AnnouncerOption(), AppendItemcodes(), bot_fixcount(), buff_Touch(), CheckPlayerJump(), CheckRules_World(), ClientKill_TeamChange(), CommonCommand_editmob(), Damage(), Draw_GrapplingHook(), Draw_ShowNames(), fireBullet_falloff(), FixPlayermodel(), formatmessage(), GameLogInit(), GetPlayerLimit(), getrecords(), GetResourceLimit(), GiveFrags(), GiveResource(), GiveResourceWithLimit(), GrapplingHookThink(), HUD_Draw(), HUD_InfoMessages(), if(), if(), if(), Item_Model(), Item_Sound(), Item_Touch(), M_Model(), monster_dropitem(), Monster_Move(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), net_handle_ServerWelcome(), Obituary(), player_anim(), player_regen(), PlayerDamage(), PlayerJump(), PlayerScore_Add(), PM_ClientMovement_UpdateStatus(), RandomItems_GetRandomItemClassName(), readlevelcvars(), readplayerstartcvars(), Say(), Scoreboard_Draw(), SendWelcomeMessage(), SetResource(), Spawn_Score(), spawnfunc(), Spectate(), SpectateNext(), SpectatePrev(), spritelookupcolor(), spritelookupicon(), spritelookuptext(), TakeResource(), TakeResourceWithLimit(), TeamBalance_FindBestTeams(), TeamBalance_GetPlayerForTeamSwitch(), TeamBalance_GetTeamCounts(), turret_checkfire(), turret_validate_target(), View_EventChase(), W_DecreaseAmmo(), W_Devastator_DoRemoteExplode(), W_Model(), W_Sound(), W_WeaponRateFactor(), W_WeaponSpeedFactor(), want_weapon(), WaypointSprite_SendEntity(), and weapon_defaultspawnfunc().

◆ MUTATOR_ADD

#define MUTATOR_ADD ( name)
Value:
Mutator_Add(MUTATOR_##name)
bool Mutator_Add(Mutator mut)
Definition base.qh:279

Definition at line 382 of file base.qh.

◆ MUTATOR_CALLHOOK

#define MUTATOR_CALLHOOK ( name,
... )
Value:
_MUTATOR_CALLHOOK(name, __VA_ARGS__)
#define _MUTATOR_CALLHOOK(name,...)
Definition base.qh:188

Definition at line 186 of file base.qh.

Referenced by accuracy_isgooddamage(), AnnouncerOption(), AppendItemcodes(), bot_fixcount(), bot_shouldattack(), buff_Touch(), buffs_BuffModel_Customize(), bumblebee_gunner_enter(), bumblebee_gunner_exit(), calculate_player_respawn_time(), ChatBubbleThink(), CheatImpulse(), CheckRules_World(), ClientCommand_spectate(), ClientConnect(), ClientDisconnect(), ClientInit_SendEntity(), ClientKill_TeamChange(), CommonCommand_editmob(), CopyBody(), CSQCModel_AutoTagIndex_Apply(), CSQCPlayer_ModelAppearance_Apply(), Damage(), DecodeLevelParms(), Draw_GrapplingHook(), Draw_ShowNames(), DrawReticle(), Drop_Special_Items(), fireBullet_falloff(), FireGrapplingHook(), FixClientCvars(), FixPlayermodel(), formatmessage(), frag_centermessage_override(), GameCommand(), GameLogInit(), get_model_parameters(), GetCvars(), GetPlayerLimit(), GetPressedKeys(), getrecords(), GetResourceLimit(), GiveFrags(), GiveResource(), GiveResourceWithLimit(), GrapplingHookThink(), havocbot_aim(), havocbot_chooserole(), HUD_Contents(), HUD_Crosshair(), HUD_Damage(), HUD_Draw(), HUD_InfoMessages(), HUD_Physics(), HUD_Powerups(), HUD_RaceTimer(), HUD_Radar(), HUD_Score(), HUD_StrafeHUD(), HUD_Vote(), IMPULSE(), Item_IsDefinitionAllowed(), Item_Model(), Item_RespawnCountdown(), Item_ScheduleRespawnIn(), Item_Sound(), Item_Touch(), LocalCommand_hud(), M_Model(), MainWindow_configureMainWindow(), Monster_Damage(), monster_dropitem(), Monster_FindTarget(), Monster_Miniboss_Setup(), Monster_Move(), Monster_Remove(), Monster_Respawn_Check(), Monster_Spawn_Setup(), Monster_ValidTarget(), MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), nade_damage(), nade_translocate_boom(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), NET_HANDLE(), net_handle_ServerWelcome(), NextLevel(), Obituary(), Physics_UpdateStats(), player_anim(), player_powerups(), player_regen(), Player_SetTeamIndex(), PlayerDamage(), PlayerJump(), PlayerPreThink(), PlayerScore_Add(), PlayerScore_Clear(), PlayerUseKey(), PM_ClientMovement_UpdateStatus(), Portal_TeleportPlayer(), PRECACHE(), PutClientInServer(), PutObserverInServer(), PutPlayerInServer(), race_SendTime(), RandomItems_GetRandomItemClassName(), readlevelcvars(), readplayerstartcvars(), ReadyRestart(), reset_map(), sandbox_Database_Save(), sandbox_ObjectFunction_Think(), Say(), Scoreboard_AccuracyStats_WouldDraw(), Scoreboard_Draw(), Scoreboard_ItemStats_WouldDraw(), Scoreboard_WouldDraw(), SendWelcomeMessage(), SetChangeParms(), SetDefaultAlpha(), SetNewParms(), SetResource(), skeleton_loadinfo(), Spawn_Score(), spawnfunc(), Spectate(), SpectateCopy(), SpectateNext(), SpectatePrev(), spritelookupcolor(), spritelookupicon(), spritelookuptext(), StartFrame(), StartItem(), SV_OnEntityPreSpawnFunction(), SV_ParseClientCommand(), sys_phys_update(), TakeResource(), TakeResourceWithLimit(), TeamBalance_FindBestTeams(), TeamBalance_GetPlayerForTeamSwitch(), TeamBalance_GetTeamCounts(), turret_checkfire(), turret_fire(), turret_fusionreactor_firecheck(), turret_initialize(), turret_think(), turret_validate_target(), URI_Get_Callback(), vehicle_initialize(), vehicles_enter(), vehicles_exit(), vehicles_touch(), View_EventChase(), viewmodel_draw(), VoteCommand_parse(), W_Arc_Attack_Bolt(), W_Blaster_Attack(), W_Crylink_Attack(), W_Crylink_Attack2(), W_DecreaseAmmo(), W_Devastator_Attack(), W_Devastator_DoRemoteExplode(), W_Electro_Attack_Bolt(), W_Electro_Attack_Orb(), W_Fireball_Attack1(), W_Fireball_Attack2(), W_Hagar_Attack(), W_Hagar_Attack2(), W_Hagar_Attack2_Load_Release(), W_HLAC_Attack(), W_HLAC_Attack2(), W_Hook_Attack2(), W_IsWeaponThrowable(), W_MineLayer_Attack(), W_Model(), W_Mortar_Attack(), W_Mortar_Attack2(), W_OverkillRocketPropelledChainsaw_Attack(), W_PlayStrengthSound(), W_Porto_Attack(), W_PrepareExplosionByDamage(), W_Reload(), W_RocketMinsta_Attack(), W_Seeker_Fire_Flac(), W_Seeker_Fire_Missile(), W_Seeker_Fire_Tag(), W_Sound(), W_ThrowWeapon(), W_WeaponRateFactor(), W_WeaponSpeedFactor(), want_weapon(), WantEventchase(), WaypointSprite_Customize(), WaypointSprite_SendEntity(), weapon_defaultspawnfunc(), weaponLocked(), weaponUseForbidden(), and WinningCondition_Scores().

◆ MUTATOR_HOOK

#define MUTATOR_HOOK ( cb,
func,
order )
Value:
MACRO_BEGIN \
MUTATOR_ONADD \
{ \
if (!CallbackChain_Add(HOOK_##cb, CB_##func, order)) \
{ \
_mutPrintFail(#cb, #func); \
return true; \
} \
} \
{ \
CallbackChain_Remove(HOOK_##cb, CB_##func); \
} \
#define MUTATOR_ONROLLBACK_OR_REMOVE
Definition base.qh:367
#define MACRO_END
Definition macro.qh:7

Definition at line 419 of file base.qh.

419#define MUTATOR_HOOK(cb, func, order) MACRO_BEGIN \
420 MUTATOR_ONADD \
421 { \
422 if (!CallbackChain_Add(HOOK_##cb, CB_##func, order)) \
423 { \
424 _mutPrintFail(#cb, #func); \
425 return true; \
426 } \
427 } \
428 MUTATOR_ONROLLBACK_OR_REMOVE \
429 { \
430 CallbackChain_Remove(HOOK_##cb, CB_##func); \
431 } \
432MACRO_END

◆ MUTATOR_HOOKABLE

#define MUTATOR_HOOKABLE ( name,
params )
Value:
#define _MUTATOR_HOOKABLE(name, params)
Definition base.qh:169

Definition at line 168 of file base.qh.

◆ MUTATOR_HOOKFUNCTION

#define MUTATOR_HOOKFUNCTION ( ...)
Value:
#define MUTATOR_HOOKFUNCTION(...)
Definition base.qh:394
#define EVAL_MUTATOR_HOOKFUNCTION(...)
Definition base.qh:396
#define OVERLOAD(F,...)
Definition misc.qh:12

Definition at line 394 of file base.qh.

394#define MUTATOR_HOOKFUNCTION(...) \
395 EVAL_MUTATOR_HOOKFUNCTION(OVERLOAD(MUTATOR_HOOKFUNCTION, __VA_ARGS__))

◆ MUTATOR_HOOKFUNCTION_2

#define MUTATOR_HOOKFUNCTION_2 ( mut,
cb )
Value:
#define MUTATOR_HOOKFUNCTION_3(mut, cb, order)
Definition base.qh:401
const int CBC_ORDER_ANY
Definition base.qh:12

Definition at line 398 of file base.qh.

398#define MUTATOR_HOOKFUNCTION_2(mut, cb) \
399 MUTATOR_HOOKFUNCTION_3(mut, cb, CBC_ORDER_ANY)

◆ MUTATOR_HOOKFUNCTION_3

#define MUTATOR_HOOKFUNCTION_3 ( mut,
cb,
order )
Value:
_MUTATOR_CALLBACK(mut##_##cb, mut##_##cb) \
ACCUMULATE bool MUTATORFUNC_##mut##_hooks(int mode) \
{ \
MUTATOR_HOOK(cb, mut##_##cb, order); \
} \
bool mut##_##cb() \
{ \
return = false; \
} \
ACCUMULATE bool mut##_##cb()
#define _MUTATOR_CALLBACK(name, func)
Definition base.qh:386

Definition at line 401 of file base.qh.

401#define MUTATOR_HOOKFUNCTION_3(mut, cb, order) \
402 _MUTATOR_CALLBACK(mut##_##cb, mut##_##cb) \
403 ACCUMULATE bool MUTATORFUNC_##mut##_hooks(int mode) \
404 { \
405 MUTATOR_HOOK(cb, mut##_##cb, order); \
406 } \
407 bool mut##_##cb() \
408 { \
409 return = false; \
410 } \
411 ACCUMULATE bool mut##_##cb()

◆ MUTATOR_IS_ENABLED

#define MUTATOR_IS_ENABLED ( this)
Value:
_MUTATOR_IS_ENABLED(MUTATOR_##this)
#define _MUTATOR_IS_ENABLED(this)
Definition base.qh:236

Definition at line 237 of file base.qh.

Referenced by MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), RandomItems_ReplaceMapItem(), and RandomItems_SpawnLootItem().

◆ MUTATOR_ONADD

◆ MUTATOR_ONREMOVE

#define MUTATOR_ONREMOVE   if (mode == MUTATOR_REMOVING)

◆ MUTATOR_ONROLLBACK_OR_REMOVE

#define MUTATOR_ONROLLBACK_OR_REMOVE   if (mode == MUTATOR_REMOVING || mode == MUTATOR_ROLLING_BACK)

◆ MUTATOR_REMOVE

#define MUTATOR_REMOVE ( name)
Value:
Mutator_Remove(MUTATOR_##name)
void Mutator_Remove(Mutator mut)
Definition base.qh:304

Definition at line 383 of file base.qh.

◆ MUTATOR_RETURNVALUE

◆ MUTATOR_STATIC

#define MUTATOR_STATIC ( )
Value:
MACRO_BEGIN \
MUTATOR_ONADD \
{ \
if (time > 1) /* game loads at time 1 */ \
error("This is a gametype and it cannot be added at runtime."); \
} \
{ \
LOG_INFO("This is a gametype and it cannot be removed at runtime."); \
return -1; \
} \
#define MUTATOR_ONREMOVE
Definition base.qh:366
float time

Definition at line 369 of file base.qh.

369#define MUTATOR_STATIC() MACRO_BEGIN \
370 MUTATOR_ONADD \
371 { \
372 if (time > 1) /* game loads at time 1 */ \
373 error("This is a gametype and it cannot be added at runtime."); \
374 } \
375 MUTATOR_ONREMOVE \
376 { \
377 LOG_INFO("This is a gametype and it cannot be removed at runtime."); \
378 return -1; \
379 } \
380MACRO_END

Referenced by REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), REGISTER_MUTATOR(), and REGISTER_MUTATOR().

◆ MUTATOR_TYPE_ARRAY

#define MUTATOR_TYPE_ARRAY ( type,
limit )
Value:
noref type MUTATOR_ARGV_##type[limit]

Definition at line 143 of file base.qh.

◆ REGISTER_MUTATOR

◆ REGISTER_MUTATOR_2

#define REGISTER_MUTATOR_2 ( id,
dependence )
Value:
_REGISTER_MUTATOR(id, dependence, Mutator)
#define _REGISTER_MUTATOR(id, dependence, cname)
Definition base.qh:325

Definition at line 350 of file base.qh.

◆ REGISTER_MUTATOR_3

#define REGISTER_MUTATOR_3 ( id,
dependence,
cname )
Value:
_REGISTER_MUTATOR(id, dependence, cname)

Definition at line 351 of file base.qh.

Typedef Documentation

◆ mutatorfunc_t

Definition at line 200 of file base.qh.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
MUTATOR_REMOVING 
MUTATOR_ADDING 
MUTATOR_ROLLING_BACK 

Definition at line 193 of file base.qh.

194{
198};
@ MUTATOR_ADDING
Definition base.qh:196
@ MUTATOR_REMOVING
Definition base.qh:195
@ MUTATOR_ROLLING_BACK
Definition base.qh:197

Function Documentation

◆ _mutPrintFail()

void _mutPrintFail ( string cb,
string func )

Definition at line 413 of file base.qh.

414{
415 // this is inside a function to avoid expanding it on compilation everytime
416 LOG_INFO("HOOK FAILED: ", cb, ":", func);
417}
#define LOG_INFO(...)
Definition log.qh:62

References LOG_INFO.

◆ Mutator_Add()

bool Mutator_Add ( Mutator mut)

Definition at line 279 of file base.qh.

280{
281 if (mut.m_added)
282 return true; // already added
283
284 mut.m_added = true;
285 mutatorfunc_t func = mut.mutatorfunc;
286 if (!func(MUTATOR_ADDING))
287 {
288 // good
289 if (mutator_log)
290 LOG_TRACEF("Mutator: added %s", mut.m_name);
291 #ifdef SVQC
292 Net_LinkEntity(mut, false, 0, Mutator_SendEntity);
293 #endif
294 return true;
295 }
296 backtrace("WARNING: when adding mutator: adding failed, rolling back\n");
297 if (func(MUTATOR_ROLLING_BACK))
298 // baaaaad
299 error("WARNING: when adding mutator: rolling back failed");
300
301 return false;
302}
bool(int) mutatorfunc_t
Definition base.qh:200
bool Mutator_SendEntity(entity this, entity to, int sf)
Definition base.qh:244
bool mutator_log
Definition base.qh:233
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
Definition net.qh:167
#define LOG_TRACEF(...)
Definition log.qh:75
#define backtrace(msg)
Definition log.qh:96
#define error
Definition pre.qh:6

References backtrace, error, LOG_TRACEF, MUTATOR_ADDING, mutator_log, MUTATOR_ROLLING_BACK, Mutator_SendEntity(), and Net_LinkEntity().

Referenced by STATIC_INIT_LATE().

◆ Mutator_Remove()

void Mutator_Remove ( Mutator mut)

Definition at line 304 of file base.qh.

305{
306 if (!mut.m_added)
307 {
308 backtrace("WARNING: removing not-added mutator\n");
309 return;
310 }
311
312 mut.m_added = false;
313 mutatorfunc_t func = mut.mutatorfunc;
314 if (func(MUTATOR_REMOVING))
315 // baaaaad
316 error("Mutator_Remove: removing mutator failed");
317
318 if (mutator_log)
319 LOG_TRACEF("Mutator: removed %s", mut.m_name);
320#ifdef SVQC
321 Net_UnlinkEntity(mut);
322#endif
323}
void Net_UnlinkEntity(entity e)
Definition net.qh:196

References backtrace, error, LOG_TRACEF, mutator_log, MUTATOR_REMOVING, and Net_UnlinkEntity().

Referenced by NET_Mutator_Remove().

◆ Mutator_SendEntity()

bool Mutator_SendEntity ( entity this,
entity to,
int sf )

Definition at line 244 of file base.qh.

245{
248 return true;
249}
WriteString(chan, ent.netname)
const int MSG_ENTITY
Definition net.qh:156
#define WriteHeader(to, id)
Definition net.qh:265
string registered_id
Registered item identifier.
Definition registry.qh:94

References entity(), MSG_ENTITY, registered_id, WriteHeader, and WriteString().

Referenced by Mutator_Add().

◆ MUTATOR_TYPE_ARRAY() [1/6]

MUTATOR_TYPE_ARRAY ( bool ,
6  )

◆ MUTATOR_TYPE_ARRAY() [2/6]

MUTATOR_TYPE_ARRAY ( entity ,
9  )

References entity().

◆ MUTATOR_TYPE_ARRAY() [3/6]

MUTATOR_TYPE_ARRAY ( float ,
11  )

◆ MUTATOR_TYPE_ARRAY() [4/6]

MUTATOR_TYPE_ARRAY ( int ,
6  )

◆ MUTATOR_TYPE_ARRAY() [5/6]

MUTATOR_TYPE_ARRAY ( string ,
5  )

◆ MUTATOR_TYPE_ARRAY() [6/6]

MUTATOR_TYPE_ARRAY ( vector ,
7  )

References vector.

◆ NET_HANDLE()

NET_HANDLE ( Mutator ,
bool isNew )

Definition at line 256 of file base.qh.

257{
258 make_pure(this);
259 string s = this.netname = ReadString();
260 return = true;
261 if (isNew)
262 {
263 make_pure(this);
264 this.entremove = NET_Mutator_Remove;
265 int added = 0;
266 WITH(bool, mutator_log, true, FOREACH(Mutators, it.registered_id == s,
267 {
268 Mutator_Add(it);
269 ++added;
270 }));
271 if (added > 1)
272 LOG_WARNF("Added more than one mutator for %s", s);
273 }
274}
void NET_Mutator_Remove(entity this)
Definition base.qh:251
#define ReadString
string netname
Definition powerups.qc:20
#define FOREACH(list, cond, body)
Definition iter.qh:19
#define LOG_WARNF(...)
Definition log.qh:59
#define WITH(type, name, value, block)
Definition misc.qh:37
#define make_pure(e)
direct use is
Definition oo.qh:13

References FOREACH, LOG_WARNF, make_pure, mutator_log, NET_Mutator_Remove(), netname, ReadString, and WITH.

◆ NET_Mutator_Remove()

void NET_Mutator_Remove ( entity this)

Definition at line 251 of file base.qh.

252{
253 string s = this.netname;
254 WITH(bool, mutator_log, true, FOREACH(Mutators, it.registered_id == s, Mutator_Remove(it)));
255}

References entity(), FOREACH, mutator_log, Mutator_Remove(), netname, and WITH.

Referenced by NET_HANDLE().

◆ RegisterCallbacks()

void RegisterCallbacks ( )

Definition at line 166 of file base.qh.

166{}

Referenced by STATIC_INIT().

◆ RegisterHooks()

void RegisterHooks ( )

Definition at line 165 of file base.qh.

165{}

Referenced by STATIC_INIT().

◆ STATIC_INIT()

STATIC_INIT ( Mutators )

Definition at line 353 of file base.qh.

354{
357 RegisterMutators();
358}

References RegisterCallbacks(), and RegisterHooks().

◆ STATIC_INIT_LATE()

STATIC_INIT_LATE ( Mutators )

Definition at line 360 of file base.qh.

361{
362 FOREACH(Mutators, _MUTATOR_IS_ENABLED(it), Mutator_Add(it));
363}

References _MUTATOR_IS_ENABLED, FOREACH, and Mutator_Add().

Variable Documentation

◆ CallbackChain_ReturnValue

bool CallbackChain_ReturnValue

read-only field of the current return value

Definition at line 14 of file base.qh.

Referenced by CallbackChain::CallbackChain_Call().

◆ CBC_ORDER_ANY

const int CBC_ORDER_ANY = 4

◆ CBC_ORDER_EXCLUSIVE

const int CBC_ORDER_EXCLUSIVE = 3

Definition at line 11 of file base.qh.

Referenced by MUTATOR_HOOKFUNCTION(), MUTATOR_HOOKFUNCTION(), and MUTATOR_HOOKFUNCTION().

◆ CBC_ORDER_FIRST

◆ CBC_ORDER_LAST

◆ m_added

bool m_added

Definition at line 234 of file base.qh.

◆ mutator_log

bool mutator_log = false

Definition at line 233 of file base.qh.

Referenced by Mutator_Add(), Mutator_Remove(), NET_HANDLE(), and NET_Mutator_Remove().