Permalink
Browse files

Improve HQ destruction in multiplayer for mods.

Useful feature for mods that allow a player to build multiple HQs.
Patch by forum member ShadowWolfTJC.
Fixes ticket:3465.
  • Loading branch information...
KJeff01 committed Sep 7, 2017
1 parent 92722cb commit 590434843c202e92d7ab7e5488f31de9e196ecfa
Showing with 3 additions and 3 deletions.
  1. +3 −3 data/mp/multiplay/skirmish/rules.js
@@ -325,10 +325,10 @@ function eventStructureBuilt(struct)
function eventDestroyed(victim)
{
if (victim.player == selectedPlayer && victim.type == STRUCTURE && victim.stattype == HQ)
if (victim.player == selectedPlayer && victim.type == STRUCTURE && victim.stattype == HQ && !enumStruct(selectedPlayer, HQ).length)
{
setMiniMap(false); // hide minimap if HQ is destroyed
setDesign(false); // and disallow design
setMiniMap(false); // hide minimap if HQ is destroyed and no other HQs are present
setDesign(false); // and disallow designs if all HQs are detroyed
}
}

0 comments on commit 5904348

Please sign in to comment.