From da22c31fc2f03446e952f28731863575f8a86835 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 9 Mar 2016 14:41:26 +1000 Subject: [PATCH] Add a new key to override the initial item respawn delay --- qcsrc/common/t_items.qc | 2 +- qcsrc/lib/spawnfunc.qh | 1 + qcsrc/server/defs.qh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/common/t_items.qc b/qcsrc/common/t_items.qc index 7da52d573..876bc6347 100644 --- a/qcsrc/common/t_items.qc +++ b/qcsrc/common/t_items.qc @@ -615,7 +615,7 @@ void Item_ScheduleRespawn(entity e) void Item_ScheduleInitialRespawn(entity e) { Item_Show(e, 0); - Item_ScheduleRespawnIn(e, game_starttime - time + ITEM_RESPAWNTIME_INITIAL(e)); + Item_ScheduleRespawnIn(e, game_starttime - time + ((e.respawntimestart) ? e.respawntimestart : ITEM_RESPAWNTIME_INITIAL(e))); } float Item_GiveAmmoTo(entity item, entity player, .float ammotype, float ammomax, float mode) diff --git a/qcsrc/lib/spawnfunc.qh b/qcsrc/lib/spawnfunc.qh index f9c056fbd..9d1090bac 100644 --- a/qcsrc/lib/spawnfunc.qh +++ b/qcsrc/lib/spawnfunc.qh @@ -152,6 +152,7 @@ noref bool require_spawnfunc_prefix; FIELD_SCALAR(fld, platmovetype) \ FIELD_SCALAR(fld, race_place) \ FIELD_SCALAR(fld, radius) \ + FIELD_SCALAR(fld, respawntimestart) \ FIELD_SCALAR(fld, respawntimejitter) \ FIELD_SCALAR(fld, respawntime) \ FIELD_SCALAR(fld, restriction) \ diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index dd47b86a4..050cccb99 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -106,6 +106,7 @@ void() player_setupanimsformodel; .float scheduledrespawntime; .float respawntime; .float respawntimejitter; +.float respawntimestart; //.float chasecam; .float damageforcescale; -- 2.39.2