This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 10153 for ps


Ignore:
Timestamp:
09/01/11 01:41:55 (13 years ago)
Author:
ben
Message:

Fixes gaia animals without UnitAI (e.g. fish) blocking foundation construction, by destroying them. Fixes #936.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/simulation/components/Foundation.js

    r9669 r10153  
    115115                    if (cmpUnitAI)
    116116                        cmpUnitAI.LeaveFoundation(this.entity);
     117                    else
     118                    {
     119                        // If obstructing fauna is gaia but doesn't have UnitAI, just destroy it
     120                        var cmpOwnership = Engine.QueryInterface(ent, IID_Ownership);
     121                        var cmpIdentity = Engine.QueryInterface(ent, IID_Identity);
     122                        if (cmpOwnership && cmpIdentity && cmpOwnership.GetOwner() == 0 && cmpIdentity.HasClass("Animal"))
     123                            Engine.DestroyEntity(ent);
     124                    }
    117125
    118126                    // TODO: What if an obstruction has no UnitAI?
Note: See TracChangeset for help on using the changeset viewer.