Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js
- ===================================================================
- --- binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js (revision 19359)
- +++ binaries/data/mods/public/maps/random/survivalofthefittest_triggers.js (working copy)
- @@ -272,27 +272,27 @@ Trigger.prototype.StartAnEnemyWave = fun
- {
- spawned = true;
- break;
- }
- - let cmpPlayer = QueryOwnerInterface(point, IID_Player);
- -
- - // Trigger point owned by Gaia if the player is defeated
- - if (cmpPlayer.GetPlayerID() == 0)
- + // Don't spawn attackers for defeated players or players who have won but lost their CC
- + let playerID = QueryOwnerInterface(point, IID_Player).GetPlayerID();
- + let civicCenter = this.playerCivicCenter[playerID];
- + if (!civicCenter)
- continue;
- - let targetPos = Engine.QueryInterface(this.playerCivicCenter[cmpPlayer.GetPlayerID()], IID_Position).GetPosition2D();
- + let targetPos = Engine.QueryInterface(civicCenter, IID_Position).GetPosition2D();
- for (let attackerTemplate of attackerTemplates)
- {
- // Don't spawn gaia hero if the previous one is still alive
- - if (attackerTemplate.hero && this.gaiaHeroes[cmpPlayer.GetPlayerID()])
- + if (attackerTemplate.hero && this.gaiaHeroes[playerID])
- {
- - let cmpHealth = Engine.QueryInterface(this.gaiaHeroes[cmpPlayer.GetPlayerID()], IID_Health);
- + let cmpHealth = Engine.QueryInterface(this.gaiaHeroes[playerID], IID_Health);
- if (cmpHealth && cmpHealth.GetHitpoints() != 0)
- {
- - this.debugLog("Not spawning hero for player " + cmpPlayer.GetPlayerID() + " as the previous one is still alive");
- + this.debugLog("Not spawning hero for player " + playerID + " as the previous one is still alive");
- continue;
- }
- }
- if (dryRun)
- @@ -307,11 +307,11 @@ Trigger.prototype.StartAnEnemyWave = fun
- "queued": true,
- "targetClasses": undefined
- });
- if (attackerTemplate.hero)
- - this.gaiaHeroes[cmpPlayer.GetPlayerID()] = entities[0];
- + this.gaiaHeroes[playerID] = entities[0];
- }
- spawned = true;
- }
- if (!spawned)
- @@ -336,11 +336,14 @@ Trigger.prototype.PlaceTreasures = funct
- };
- Trigger.prototype.OnOwnershipChanged = function(data)
- {
- if (data.entity == this.playerCivicCenter[data.from])
- + {
- + this.playerCivicCenter[data.from] = undefined;
- TriggerHelper.DefeatPlayer(data.from);
- + }
- else if (data.entity == this.treasureFemale[data.from])
- {
- this.treasureFemale[data.from] = undefined;
- Engine.DestroyEntity(data.entity);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement