From: TimePath Date: Mon, 24 Aug 2015 00:22:35 +0000 (+1000) Subject: Use STATIC_INIT X-Git-Tag: xonotic-v0.8.2~2042^2~9 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=657469c39a3f289dd73ddc653d074445ef84106e;p=xonotic%2Fxonotic-data.pk3dir.git Use STATIC_INIT --- diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 98147bfa3..0fc713f69 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -572,7 +572,6 @@ void spawnfunc___init_dedicated_server(void) void Map_MarkAsRecent(string m); float world_already_spawned; void Nagger_Init(); -void Item_ItemsTime_Init(); void ClientInit_Spawn(); void WeaponStats_Init(); void WeaponStats_Shutdown(); @@ -812,19 +811,6 @@ void spawnfunc_worldspawn (void) addstat(STAT_ARC_HEAT, AS_FLOAT, arc_heat_percent); - // items time - addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time); - addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time); - addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time); - addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time); - addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time); - addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time); - addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time); - addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time); - addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time); - addstat(STAT_SUPERWEAPONS_TIME, AS_FLOAT, item_superweapons_time); - Item_ItemsTime_Init(); - // freeze attacks addstat(STAT_FROZEN, AS_INT, frozen); addstat(STAT_REVIVE_PROGRESS, AS_FLOAT, revive_progress); diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 7d173d73a..2abee7931 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -436,6 +436,22 @@ void Item_ItemsTime_Init() it_jetpack_time = -1; it_superweapons_time = -1; } + +STATIC_INIT(ItemsTime_Init) { + // items time + addstat(STAT_ARMOR_LARGE_TIME, AS_FLOAT, item_armor_large_time); + addstat(STAT_HEALTH_MEGA_TIME, AS_FLOAT, item_health_mega_time); + addstat(STAT_INVISIBLE_TIME, AS_FLOAT, item_invisible_time); + addstat(STAT_SPEED_TIME, AS_FLOAT, item_speed_time); + addstat(STAT_EXTRALIFE_TIME, AS_FLOAT, item_extralife_time); + addstat(STAT_STRENGTH_TIME, AS_FLOAT, item_strength_time); + addstat(STAT_SHIELD_TIME, AS_FLOAT, item_shield_time); + addstat(STAT_FUELREGEN_TIME, AS_FLOAT, item_fuelregen_time); + addstat(STAT_JETPACK_TIME, AS_FLOAT, item_jetpack_time); + addstat(STAT_SUPERWEAPONS_TIME, AS_FLOAT, item_superweapons_time); + Item_ItemsTime_Init(); +} + void Item_ItemsTime_ResetTimes() { it_armor_large_time = (it_armor_large_time == -1) ? -1 : 0;