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 21834 for ps


Ignore:
Timestamp:
06/03/18 13:49:55 (7 years ago)
Author:
elexis
Message:

Fix an OOS on rejoin on Danubius following rP20957, refs #4855, fixes #5198.

Vectors are still deserialized as objects without their prototype functions, so doing math on these obejcts fails upon rejoin, refs #4698.
This patch doesn't add any version incompatibilities and players with the patched version can successfully rejoin unpatched games.

Differential Revision: https://code.wildfiregames.com/D1548
Reviewed By: temple

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/binaries/data/mods/public/maps/random/danubius_triggers.js

    r21767 r21834  
    487487Trigger.prototype.IsLeftRiverside = function(ent)
    488488{
    489     return this.riverDirection.cross(Vector2D.sub(TriggerHelper.GetEntityPosition2D(ent), this.mapCenter)) > 0;
     489    return Vector2D.sub(TriggerHelper.GetEntityPosition2D(ent), this.mapCenter).cross(this.riverDirection) < 0;
    490490};
    491491
     
    616616
    617617    // Be able to distinguish between the left and right riverside
     618    // TODO: The Vector2D types don't survive deserialization, so use an object with x and y properties only!
    618619    let mapSize = TriggerHelper.GetMapSizeTerrain();
    619     this.mapCenter = new Vector2D(mapSize / 2, mapSize / 2);
    620     this.riverDirection = Vector2D.sub(
     620    this.mapCenter = clone(new Vector2D(mapSize / 2, mapSize / 2));
     621
     622    this.riverDirection = clone(Vector2D.sub(
    621623        TriggerHelper.GetEntityPosition2D(this.GetTriggerPoints(triggerPointRiverDirection)[0]),
    622         this.mapCenter);
     624        this.mapCenter));
    623625
    624626    this.StartCelticRitual();
Note: See TracChangeset for help on using the changeset viewer.