Ticket #3149: ticket3149_observer_undefined_mirage.patch

File ticket3149_observer_undefined_mirage.patch, 1.2 KB (added by elexis, 9 years ago)

sry typo in last patch

  • binaries/data/mods/public/simulation/components/Fogging.js

     
    154154
    155155Fogging.prototype.IsMiraged = function(player)
    156156{
    157     if (player >= this.mirages.length)
     157    if (player < 0 || player >= this.mirages.length)
    158158        return false;
    159159
    160160    return this.miraged[player];
     
    162162
    163163Fogging.prototype.GetMirage = function(player)
    164164{
    165     if (player >= this.mirages.length)
     165    if (player < 0 || player >= this.mirages.length)
    166166        return INVALID_ENTITY;
    167167
    168168    return this.mirages[player];
     
    170170
    171171Fogging.prototype.WasSeen = function(player)
    172172{
    173     if (player >= this.seen.length)
     173    if (player < 0 || player >= this.seen.length)
    174174        return false;
    175175
    176176    return this.seen[player];
     
    202202
    203203Fogging.prototype.OnVisibilityChanged = function(msg)
    204204{
    205     if (msg.player >= this.mirages.length)
     205    if (msg.player < 0 || msg.player >= this.mirages.length)
    206206        return;
    207207
    208208    if (msg.newVisibility == VIS_VISIBLE)