2019-12-12 07:33 CET

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000226Spring engineGeneralpublic2006-07-06 20:43
ReporterRafal99 
Assigned Totvo 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000226: Build bug can still detect enemy units outside LOS
DescriptionSorry for duplicating but previous report was closed.

Detecting enemy buildings by build checker was fixed but we can still detect enemy units!
 
Screenshot from compiled revision 1567.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • jpg file icon buildbug.JPG (37,511 bytes) 2006-07-03 00:37 -
    jpg file icon buildbug.JPG (37,511 bytes) 2006-07-03 00:37 +
  • patch file icon UnitHandler.cpp.patch (896 bytes) 2006-07-03 01:10 -
    Index: UnitHandler.cpp
    ===================================================================
    --- UnitHandler.cpp	(revision 1564)
    +++ UnitHandler.cpp	(working copy)
    @@ -313,10 +313,14 @@
     	if(s=readmap->GroundBlocked(yardypos*gs->mapx+yardxpos)){
     		if(dynamic_cast<CFeature*>(s))
     			feature=(CFeature*)s;
    -		else if(s->immobile)
    -			return 0;
    -		else
    +		else if(!dynamic_cast<CUnit*>(s) || (((CUnit*)s)->losStatus[gu->myAllyTeam] & LOS_INLOS)))
    +		{
    +		else if(s->immobile) {
    +			if(unit && (unit->losStatus[gu->myAllyTeam] & LOS_INLOS))
    +				return 0;
    +		} else
     			ret=1;
    +		}
     	}
     	int square=ground->GetSquare(pos);
     
    @@ -336,11 +340,6 @@
     		return 0;
     	if(groundheight>-unitdef->minWaterDepth)
     		return 0;
    -	std::set<CUnit*>::iterator ui = selectedUnits.selectedUnits.begin();
    -	std::vector<Command> cv;
    -	for(;ui != selectedUnits.selectedUnits.end(); ui++){
    -	
    -	}
     
     	return ret;
     }
    
    patch file icon UnitHandler.cpp.patch (896 bytes) 2006-07-03 01:10 +
  • patch file icon newUnitHandler.cpp.patch (661 bytes) 2006-07-06 09:14 -
    Index: UnitHandler.cpp
    ===================================================================
    --- UnitHandler.cpp	(revision 1577)
    +++ UnitHandler.cpp	(working copy)
    @@ -313,12 +313,13 @@
     	if(s=readmap->GroundBlocked(yardypos*gs->mapx+yardxpos)){
     		if(dynamic_cast<CFeature*>(s))
     			feature=(CFeature*)s;
    -		else if(s->immobile) {
    -			CUnit* unit=dynamic_cast<CUnit*>(s);
    -			if(unit && (unit->losStatus[gu->myAllyTeam] & LOS_INLOS))
    +		else if(!dynamic_cast<CUnit*>(s) || (((CUnit*)s)->losStatus[gu->myAllyTeam] & LOS_INLOS))
    +		{
    +			if(s->immobile)
     				return 0;
    -		} else
    -			ret=1;
    +			else
    +				ret=1;
    +		}
     	}
     	int square=ground->GetSquare(pos);
     
    
    patch file icon newUnitHandler.cpp.patch (661 bytes) 2006-07-06 09:14 +

-Relationships
+Relationships

-Notes

~0000273

alphabeta (reporter)

Last edited: 2006-07-03 01:13

silly oversight on my part.. heres updated patch

I didn't really think about units that didn't move (the topic I set out to fix only mentioned structures). Now it applies to all units not in LOS

~0000277

alphabeta (reporter)

whoooops.. I don't know what I was thinking. that patch is screwy. here's a working one (the last one worked.. but had some redundancy)

~0000285

tvo (reporter)

patch committed
+Notes

-Issue History
Date Modified Username Field Change
2006-07-03 00:37 Rafal99 New Issue
2006-07-03 00:37 Rafal99 File Added: buildbug.JPG
2006-07-03 00:59 alphabeta Note Added: 0000273
2006-07-03 01:10 alphabeta File Added: UnitHandler.cpp.patch
2006-07-03 01:12 alphabeta Note Edited: 0000273
2006-07-03 01:13 alphabeta Note Edited: 0000273
2006-07-06 09:13 alphabeta Note Added: 0000277
2006-07-06 09:14 alphabeta File Added: newUnitHandler.cpp.patch
2006-07-06 20:42 tvo Status new => assigned
2006-07-06 20:42 tvo Assigned To => tvo
2006-07-06 20:43 tvo Status assigned => resolved
2006-07-06 20:43 tvo Resolution open => fixed
2006-07-06 20:43 tvo Note Added: 0000285
+Issue History