2025-07-27 08:27 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0003814Spring engineGeneralpublic2013-06-02 15:34
Reporterjamerlan 
Assigned Tocleanrock 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version94.1 
Target Version95.0Fixed in Version 
Summary0003814: If you share underwater unit to ally - it becomes invisible for both (ally and you)
DescriptionIf you share underwater unit (any kind. For example - landed seaplanes) - you can't see it anymore but your ally can't see it too.
Steps To Reproduce1. Share underwater units to ally
2. These units becomes invisible
Additional Informationtake a look at attached demo.
Infolog.txt : http://pastebin.com/7VhwPmJA
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • ? file icon 20130526_021002_Schizo_Shores_v4_94.sdf (67,068 bytes) 2013-05-26 00:18
  • patch file icon ChangeTeam.patch (727 bytes) 2013-06-01 11:27 -
    diff --git a/rts/Sim/Units/Unit.cpp b/rts/Sim/Units/Unit.cpp
    index 7212c07..dc793b9 100644
    --- a/rts/Sim/Units/Unit.cpp
    +++ b/rts/Sim/Units/Unit.cpp
    @@ -1407,7 +1407,6 @@ bool CUnit::ChangeTeam(int newteam, ChangeType type)
     	quads.clear();
     	loshandler->FreeInstance(los);
     	los = 0;
    -	losStatus[allyteam] = 0;
     	radarhandler->RemoveUnit(this);
     
     	if (unitDef->isAirBase) {
    @@ -1439,6 +1438,7 @@ bool CUnit::ChangeTeam(int newteam, ChangeType type)
     	unitHandler->unitsByDefs[newteam][unitDef->id].insert(this);
     
     	for (int at = 0; at < teamHandler->ActiveAllyTeams(); ++at) {
    +		losStatus[at] = (at == allyteam) ? LOS_ALL_MASK_BITS | LOS_INLOS | LOS_INRADAR | LOS_PREVLOS | LOS_CONTRADAR : 0;
     		UpdateLosStatus(at);
     	}
     
    
    patch file icon ChangeTeam.patch (727 bytes) 2013-06-01 11:27 +

-Relationships
related to 0003544resolvedKloot Unit dissapears for 0.5 seconds when team transfered 
+Relationships

-Notes

~0010766

jamerlan (reporter)

[02:15:45] <[Fx]Bluestone> decay is right with his bug btw, you can really make units vanish (when sharing underwater) :p

~0010767

jamerlan (reporter)

Shit, I just realized that SPECTATORS can see shared underwater units... so you need to reproduce it manually while playing.

Just add AI as ally and share him underwater units

~0010790

cleanrock (reporter)

I was unable to reproduce this with BA 7.76 with both 94.1 and 94.1.1-592-gb53a627 develop (OMP). I shared a submarine and a seaplane to ally AI and i could still see them.

~0010791

jamerlan (reporter)

try to share t1 mexes. We were testing on them

~0010792

jamerlan (reporter)

also, maybe you was close to them with your own units. Just share mexes (for example) not near of your units

~0010794

cleanrock (reporter)

I can reproduce this problem with mexes on 94.1 and develop 8f53c96a.
I will probably try a bisect but i think jk and kloot should look at this, one of em should have an idea of when they broke it :).

~0010795

cleanrock (reporter)

bisect attempt failed, bisecting spring on arch seem to be a nightmare, every version git bisect tried crashed for me.

~0010796

jamerlan (reporter)

maybe this bugfix affected visibility behaviour? http://springrts.com/mantis/view.php?id=3544

https://github.com/spring/spring/commit/13b887e5f822c5c2c170de8c4a6819c339d3251a

~0010797

jamerlan (reporter)

or maybe this: http://springrts.com/mantis/view.php?id=3481

https://github.com/spring/spring/commit/ee13fb168cc8ebd4943588f891ddd0e791efa762

~0010799

cleanrock (reporter)

I attached a patch (ChangeTeam.patch) that fix this particular problem but it may also break 3544.

I suspect it is these lines in LosHandler::InLos(const CUnit* unit, int allyTeam) that cause the problem
        if (unit->IsUnderWater() && requireSonarUnderWater)
            return (radarhandler->InRadar(unit, allyTeam));
but i think this problem should be corrected in by CUnit::ChangeTeam.

~0010803

cleanrock (reporter)

Kloot, i dont dare to commit this, can u resolve this ?
+Notes

-Issue History
Date Modified Username Field Change
2013-05-26 00:18 jamerlan New Issue
2013-05-26 00:18 jamerlan File Added: 20130526_021002_Schizo_Shores_v4_94.sdf
2013-05-26 00:20 jamerlan Note Added: 0010766
2013-05-26 01:04 jamerlan Note Added: 0010767
2013-05-26 15:37 abma Target Version => 95.0
2013-05-30 16:28 cleanrock Note Added: 0010790
2013-05-30 17:34 jamerlan Note Added: 0010791
2013-05-30 17:35 jamerlan Note Added: 0010792
2013-05-31 15:44 cleanrock Note Added: 0010794
2013-05-31 16:29 cleanrock Note Added: 0010795
2013-05-31 17:03 jamerlan Note Added: 0010796
2013-05-31 17:06 jamerlan Note Added: 0010797
2013-06-01 11:26 cleanrock Note Added: 0010799
2013-06-01 11:27 cleanrock File Added: ChangeTeam.patch
2013-06-01 19:04 cleanrock Note Added: 0010803
2013-06-02 09:15 cleanrock Assigned To => cleanrock
2013-06-02 09:15 cleanrock Status new => assigned
2013-06-02 10:46 cleanrock Changeset attached => spring develop fd26f177
2013-06-02 10:46 cleanrock Status assigned => resolved
2013-06-02 10:46 cleanrock Resolution open => fixed
2013-06-02 15:34 abma Relationship added related to 0003544
+Issue History