From: FruitieX Date: Tue, 30 Nov 2010 14:33:53 +0000 (+0200) Subject: move freezetag specific damage/force code into a PlayerDamage hook, fix the mapinfo... X-Git-Tag: xonotic-v0.1.0preview~86^2~2^2~3 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=412981090557b948970f64ba5625c397d8fafca4;p=xonotic%2Fxonotic-data.pk3dir.git move freezetag specific damage/force code into a PlayerDamage hook, fix the mapinfo display in the menu --- diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c index 467357810..10bd56bf3 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c @@ -28,6 +28,7 @@ CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog) ATTRIB(XonoticMapInfoDialog, typeRaceLabel, entity, NULL) ATTRIB(XonoticMapInfoDialog, typeCTSLabel, entity, NULL) ATTRIB(XonoticMapInfoDialog, typeNexballLabel, entity, NULL) + ATTRIB(XonoticMapInfoDialog, typeFreezetagLabel, entity, NULL) ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0) ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null) @@ -83,6 +84,7 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb) me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE); me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS); me.typeNexballLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_NEXBALL); + me.typeFreezetagLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_FREEZETAG); MapInfo_ClearTemps(); } diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 7af3a866a..cde87fec1 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -528,15 +528,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float if (attacker.isbot) damage = damage * bound(0.1, (skill + 5) * 0.1, 1); - if(g_freezetag) - { - if(targ.freezetag_frozen == 1) - { - damage = 0; - force = force * cvar("g_freezetag_frozen_force"); - } - } - // nullify damage if teamplay is on if(deathtype != DEATH_TELEFRAG) if(attacker.classname == "player") diff --git a/qcsrc/server/mutators/gamemode_freezetag.qc b/qcsrc/server/mutators/gamemode_freezetag.qc index 668215850..7ecde3694 100644 --- a/qcsrc/server/mutators/gamemode_freezetag.qc +++ b/qcsrc/server/mutators/gamemode_freezetag.qc @@ -257,6 +257,20 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics) return 1; } +MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage) +{ + if(g_freezetag) + { + if(frag_target.freezetag_frozen == 1) + { + damage_take = 0; + damage_save = 0; + damage_force = damage_force * cvar("g_freezetag_frozen_force"); + } + } + return 1; +} + MUTATOR_DEFINITION(gamemode_freezetag) { MUTATOR_HOOK(MakePlayerObserver, freezetag_RemovePlayer, CBC_ORDER_ANY); @@ -266,6 +280,7 @@ MUTATOR_DEFINITION(gamemode_freezetag) MUTATOR_HOOK(GiveFragsForKill, freezetag_GiveFragsForKill, CBC_ORDER_FIRST); MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST); MUTATOR_HOOK(PlayerPhysics, freezetag_PlayerPhysics, CBC_ORDER_FIRST); + MUTATOR_HOOK(PlayerDamage, freezetag_PlayerDamage, CBC_ORDER_ANY); MUTATOR_ONADD {