From: Mario Date: Fri, 24 Feb 2017 10:04:39 +0000 (+1000) Subject: Use StartItem on monster's dropped items instead of referencing spawn functions X-Git-Tag: xonotic-v0.8.2~180 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d82ab19c1b9bc8443574724168fc229d9bf7c269;p=xonotic%2Fxonotic-data.pk3dir.git Use StartItem on monster's dropped items instead of referencing spawn functions --- diff --git a/qcsrc/common/monsters/monster/mage.qc b/qcsrc/common/monsters/monster/mage.qc index 39f498230..251b1edc7 100644 --- a/qcsrc/common/monsters/monster/mage.qc +++ b/qcsrc/common/monsters/monster/mage.qc @@ -450,7 +450,6 @@ METHOD(Mage, mr_anim, bool(Mage this, entity actor)) #endif #ifdef SVQC .float speed; -spawnfunc(item_health_big); METHOD(Mage, mr_setup, bool(Mage this, entity actor)) { TC(Mage, this); @@ -460,7 +459,7 @@ METHOD(Mage, mr_setup, bool(Mage this, entity actor)) if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_mage_speed_stop); } if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_mage_damageforcescale); } - actor.monster_loot = spawnfunc_item_health_big; + actor.monster_loot = ITEM_HealthBig; actor.monster_attackfunc = M_Mage_Attack; return true; diff --git a/qcsrc/common/monsters/monster/shambler.qc b/qcsrc/common/monsters/monster/shambler.qc index 6baa45347..a5863623e 100644 --- a/qcsrc/common/monsters/monster/shambler.qc +++ b/qcsrc/common/monsters/monster/shambler.qc @@ -244,7 +244,6 @@ METHOD(Shambler, mr_anim, bool(Shambler this, entity actor)) } #endif #ifdef SVQC -spawnfunc(item_health_mega); .float animstate_endtime; METHOD(Shambler, mr_setup, bool(Shambler this, entity actor)) { @@ -256,7 +255,7 @@ METHOD(Shambler, mr_setup, bool(Shambler this, entity actor)) if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_shambler_speed_stop); } if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_shambler_damageforcescale); } - actor.monster_loot = spawnfunc_item_health_mega; + actor.monster_loot = ITEM_HealthMega; actor.weapon = WEP_ELECTRO.m_id; // matches attacks better than WEP_VORTEX setanim(actor, actor.anim_shoot, false, true, true); diff --git a/qcsrc/common/monsters/monster/spider.qc b/qcsrc/common/monsters/monster/spider.qc index 8c90ade8a..7ec7f95ac 100644 --- a/qcsrc/common/monsters/monster/spider.qc +++ b/qcsrc/common/monsters/monster/spider.qc @@ -228,7 +228,6 @@ METHOD(Spider, mr_anim, bool(Spider this, entity actor)) } #endif #ifdef SVQC -spawnfunc(item_health_medium); METHOD(Spider, mr_setup, bool(Spider this, entity actor)) { TC(Spider, this); @@ -238,7 +237,7 @@ METHOD(Spider, mr_setup, bool(Spider this, entity actor)) if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_spider_speed_stop); } if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_spider_damageforcescale); } - actor.monster_loot = spawnfunc_item_health_medium; + actor.monster_loot = ITEM_HealthMedium; actor.monster_attackfunc = M_Spider_Attack; return true; diff --git a/qcsrc/common/monsters/monster/wyvern.qc b/qcsrc/common/monsters/monster/wyvern.qc index 92a098abf..b4a76c99f 100644 --- a/qcsrc/common/monsters/monster/wyvern.qc +++ b/qcsrc/common/monsters/monster/wyvern.qc @@ -148,7 +148,6 @@ METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor)) } #endif #ifdef SVQC -spawnfunc(item_cells); METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor)) { TC(Wyvern, this); @@ -158,7 +157,7 @@ METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor)) if(!actor.stopspeed) { actor.stopspeed = (autocvar_g_monster_wyvern_speed_stop); } if(!actor.damageforcescale) { actor.damageforcescale = (autocvar_g_monster_wyvern_damageforcescale); } - actor.monster_loot = spawnfunc_item_cells; + actor.monster_loot = ITEM_Cells; actor.monster_attackfunc = M_Wyvern_Attack; return true; diff --git a/qcsrc/common/monsters/monster/zombie.qc b/qcsrc/common/monsters/monster/zombie.qc index d9f866e9d..6893d31b6 100644 --- a/qcsrc/common/monsters/monster/zombie.qc +++ b/qcsrc/common/monsters/monster/zombie.qc @@ -192,7 +192,7 @@ METHOD(Zombie, mr_setup, bool(Zombie this, entity actor)) actor.spawnflags |= MONSTER_RESPAWN_DEATHPOINT; - actor.monster_loot = spawnfunc_item_health_medium; + actor.monster_loot = ITEM_HealthMedium; actor.monster_attackfunc = M_Zombie_Attack; actor.spawnshieldtime = actor.spawn_time; actor.respawntime = 0.2; diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 3e90b07e4..94acdd28b 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -46,7 +46,7 @@ void monster_dropitem(entity this, entity attacker) if(e && e.monster_loot) { e.noalign = true; - e.monster_loot(e); + StartItem(e, e.monster_loot); e.gravity = 1; set_movetype(e, MOVETYPE_TOSS); e.reset = SUB_Remove; diff --git a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc index 65b7b5256..eab41c586 100644 --- a/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc +++ b/qcsrc/common/mutators/mutator/instagib/sv_instagib.qc @@ -137,7 +137,7 @@ MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterDropItem) { entity item = M_ARGV(1, entity); - item.monster_loot = spawnfunc_item_minst_cells; + item.monster_loot = ITEM_VaporizerCells; } MUTATOR_HOOKFUNCTION(mutator_instagib, MonsterSpawn) diff --git a/qcsrc/server/mutators/events.qh b/qcsrc/server/mutators/events.qh index 2d32dc966..7f30dbba8 100644 --- a/qcsrc/server/mutators/events.qh +++ b/qcsrc/server/mutators/events.qh @@ -294,7 +294,7 @@ MUTATOR_HOOKABLE(MonsterRespawn, EV_MonsterRespawn); /**/ o(entity, MUTATOR_ARGV_1_entity) \ /* attacker */ i(entity, MUTATOR_ARGV_2_entity) \ /**/ -.void(entity this) monster_loot; +.entity monster_loot; MUTATOR_HOOKABLE(MonsterDropItem, EV_MonsterDropItem); /**