2024-04-25 00:45 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000530Spring engineGeneralpublic2007-05-02 12:00
Reportersemi 
Assigned Totvo 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000530: [patch] CSolidObject::GetMapPos is off by one at bottom edge and right edge
DescriptionGroundBlocking of a building that is built at the bottom edge or right edge of the map is off by one towards the center of the map. The graphics are at correct location, so they are inconsistent with the groundblocking.

There is a simple off by one error in CSolidObject::GetMapPos that my patch fixes and I have tested that it works.
Steps To ReproduceBuild any building as down as possible on the map, then build a perimeter camera _on_ that building touching the map edge. This should not be possible but is. Then try to build anything above that building, touching its upper edge. This is not possible, unless you leave a small gap between them, even though it should be possible. Similar process to the right edge. I'll try to attach a screenshot too.
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • diff file icon GetMapPos_semi.diff (497 bytes) 2007-05-02 10:55 -
    Index: rts/Sim/Objects/SolidObject.cpp
    ===================================================================
    --- rts/Sim/Objects/SolidObject.cpp	(revision 3706)
    +++ rts/Sim/Objects/SolidObject.cpp	(working copy)
    @@ -177,13 +177,13 @@
     
     	if(p.x<0)
     		p.x=0;
    -	if(p.x>gs->mapx-xsize-1)
    -		p.x=gs->mapx-xsize-1;
    +	if(p.x>gs->mapx-xsize)
    +		p.x=gs->mapx-xsize;
     
     	if(p.y<0)
     		p.y=0;
    -	if(p.y>gs->mapy-ysize-1)
    -		p.y=gs->mapy-ysize-1;
    +	if(p.y>gs->mapy-ysize)
    +		p.y=gs->mapy-ysize;
     
     	return p;
     }
    
    diff file icon GetMapPos_semi.diff (497 bytes) 2007-05-02 10:55 +
  • jpg file icon GetMapPos_off_by_one.jpg (207,252 bytes) 2007-05-02 10:56 -
    jpg file icon GetMapPos_off_by_one.jpg (207,252 bytes) 2007-05-02 10:56 +

-Relationships
+Relationships

-Notes

~0000903

tvo (reporter)

Looks fine and assuming it works fine too => Committed.

Thanks for your contribution!
+Notes

-Issue History
Date Modified Username Field Change
2007-05-02 10:55 semi New Issue
2007-05-02 10:55 semi File Added: GetMapPos_semi.diff
2007-05-02 10:56 semi File Added: GetMapPos_off_by_one.jpg
2007-05-02 11:59 tvo Status new => assigned
2007-05-02 11:59 tvo Assigned To => tvo
2007-05-02 12:00 tvo Status assigned => resolved
2007-05-02 12:00 tvo Resolution open => fixed
2007-05-02 12:00 tvo Note Added: 0000903
+Issue History