Ticket #2160: undeletable_hero_v1.patch

File undeletable_hero_v1.patch, 617 bytes (added by elexis, 8 years ago)

The hero should also become undeletable to avoid accidental deletes and as players should use the resign-feature if they want to do that.

  • binaries/data/mods/public/maps/scripts/Regicide.js

    Trigger.prototype.SpawnRegicideHero = fu  
    8787            if (!hero.length)
    8888                continue;
    8989
    9090            hero = hero[0];
    9191
     92            let cmpHealth = Engine.QueryInterface(hero, IID_Health);
     93            cmpHealth.SetUndeletable(true);
     94
    9295            if (isShip)
    9396            {
    9497                let cmpUnitAI = Engine.QueryInterface(hero, IID_UnitAI);
    9598                cmpUnitAI.Garrison(spawnPoint);
    9699            }