]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Less STATIC_INIT calls in race code + small cleanup
authorterencehill <piuntn@gmail.com>
Sat, 27 Jul 2019 16:56:44 +0000 (18:56 +0200)
committerterencehill <piuntn@gmail.com>
Sat, 27 Jul 2019 16:56:44 +0000 (18:56 +0200)
qcsrc/common/gamemodes/gamemode/ctf/sv_ctf.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/weapons/weapon/blaster.qh
qcsrc/common/weapons/weapon/hook.qh
qcsrc/server/race.qc
qcsrc/server/race.qh

index 679dd850257a3286db8a56d1ecf76bc67971be31..b1518bd4fc1825df24868ce50597f31cb1368d4c 100644 (file)
@@ -28,7 +28,8 @@ CLASS(Flag, Pickup)
     ATTRIB(Flag, m_mins, vector, (PL_MIN_CONST + '0 0 -13') * 1.4); // scaling be damned
     ATTRIB(Flag, m_maxs, vector, (PL_MAX_CONST + '0 0 -13') * 1.4);
 ENDCLASS(Flag)
-Flag CTF_FLAG; STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
+Flag CTF_FLAG;
+STATIC_INIT(Flag) { CTF_FLAG = NEW(Flag); }
 void ctf_FlagTouch(entity this, entity toucher) { ITEM_HANDLE(Pickup, CTF_FLAG, this, toucher); }
 
 // flag constants // for most of these, there is just one question to be asked: WHYYYYY?
index 86e780e0a4657aa523489eb0b9ad82bc7bf9f698..efdd836d21e8af7bedd7de2ebffe8555031e173a 100644 (file)
@@ -36,7 +36,8 @@ CLASS(OffhandMageTeleport, OffhandWeapon)
         player.OffhandMageTeleport_key_pressed = key_pressed;
     }
 ENDCLASS(OffhandMageTeleport)
-OffhandMageTeleport OFFHAND_MAGE_TELEPORT; STATIC_INIT(OFFHAND_MAGE_TELEPORT) { OFFHAND_MAGE_TELEPORT = NEW(OffhandMageTeleport); }
+OffhandMageTeleport OFFHAND_MAGE_TELEPORT;
+STATIC_INIT(OFFHAND_MAGE_TELEPORT) { OFFHAND_MAGE_TELEPORT = NEW(OffhandMageTeleport); }
 
 float autocvar_g_monster_mage_health;
 float autocvar_g_monster_mage_damageforcescale = 0.5;
index 00ec43523e6a1bb2921027e2989dbe297f8fcb37..c6a853d0e11bf02ac8a7ee8c540870d88097d2e4 100644 (file)
@@ -1250,7 +1250,8 @@ CLASS(NadeOffhand, OffhandWeapon)
                }
     }
 ENDCLASS(NadeOffhand)
-NadeOffhand OFFHAND_NADE; STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
+NadeOffhand OFFHAND_NADE;
+STATIC_INIT(OFFHAND_NADE) { OFFHAND_NADE = NEW(NadeOffhand); }
 
 MUTATOR_HOOKFUNCTION(nades, ForbidThrowCurrentWeapon, CBC_ORDER_LAST)
 {
index c9825adf0b06d5f3ed4d936d1216680318f278a9..6297bdf37b5f78875414d9ee01f8df09fd5cce36 100644 (file)
@@ -50,7 +50,8 @@ SPAWNFUNC_WEAPON(weapon_laser, WEP_BLASTER)
 
 CLASS(OffhandBlaster, OffhandWeapon)
 ENDCLASS(OffhandBlaster)
-OffhandBlaster OFFHAND_BLASTER; STATIC_INIT(OFFHAND_BLASTER) { OFFHAND_BLASTER = NEW(OffhandBlaster); }
+OffhandBlaster OFFHAND_BLASTER;
+STATIC_INIT(OFFHAND_BLASTER) { OFFHAND_BLASTER = NEW(OffhandBlaster); }
 
 #ifdef SVQC
 .float blaster_damage;
index 53bb382916491d9b6a90cec009a9b75c72fb0508..bff975e005479ce5d12eaf5751ec11b6b06843f2 100644 (file)
@@ -62,7 +62,8 @@ CLASS(OffhandHook, OffhandWeapon)
     }
 #endif
 ENDCLASS(OffhandHook)
-OffhandHook OFFHAND_HOOK; STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
+OffhandHook OFFHAND_HOOK;
+STATIC_INIT(OFFHAND_HOOK) { OFFHAND_HOOK = NEW(OffhandHook); }
 
 #ifdef SVQC
 
index b3241838b039ef1523703f759856d86053e8c0b8..9a12a04866c2c251fdd333725f0a22c4af757fff 100644 (file)
 #include "../common/mutators/mutator/waypoints/waypointsprites.qh"
 
 IntrusiveList g_race_targets;
-STATIC_INIT(g_race_targets) { g_race_targets = IL_NEW(); }
+IntrusiveList g_racecheckpoints;
+STATIC_INIT(g_race)
+{
+       g_race_targets = IL_NEW();
+       g_racecheckpoints = IL_NEW();
+}
 
 void race_InitSpectator()
 {
index 4402e22568ce1f027c26f93e6cba1a0e339f278c..4dafbcf63710615df0b75b9ee07df04f4e9718d6 100644 (file)
@@ -31,9 +31,6 @@ float race_completing;
 .float race_respawn_checkpoint;
 .entity race_respawn_spotref; // try THIS spawn in case you respawn
 
-IntrusiveList g_racecheckpoints;
-STATIC_INIT(g_racecheckpoints) { g_racecheckpoints = IL_NEW(); }
-
 // definitions for functions used outside race.qc
 float race_PreviousCheckpoint(float f);
 float race_NextCheckpoint(float f);