From: <tu...@us...> - 2014-07-09 17:52:53
|
Revision: 826 http://sourceforge.net/p/polserver/code/826 Author: turley Date: 2014-07-09 17:52:49 +0000 (Wed, 09 Jul 2014) Log Message: ----------- fixed ListMultisInBox not returning multis if center item is not in the box Modified Paths: -------------- trunk/pol-core/pol/module/uomod.cpp Modified: trunk/pol-core/pol/module/uomod.cpp =================================================================== --- trunk/pol-core/pol/module/uomod.cpp 2014-07-05 09:40:15 UTC (rev 825) +++ trunk/pol-core/pol/module/uomod.cpp 2014-07-09 17:52:49 UTC (rev 826) @@ -2436,8 +2436,25 @@ std::unique_ptr<ObjArray> newarr( new ObjArray ); + // extend the coords to find the center item + // but only as parameter for the filter function + unsigned short x1range = x1; + unsigned short x2range = x2 + RANGE_VISUAL_LARGE_BUILDINGS; + unsigned short y1range = y1; + unsigned short y2range = y2 + RANGE_VISUAL_LARGE_BUILDINGS; + + if (x1range >= RANGE_VISUAL_LARGE_BUILDINGS) + x1range -= RANGE_VISUAL_LARGE_BUILDINGS; + else + x1range = 0; + if (y1range >= RANGE_VISUAL_LARGE_BUILDINGS) + y1range -= RANGE_VISUAL_LARGE_BUILDINGS; + else + y1range = 0; + + internal_InBoxAreaChecks( x1range,y1range,z1,x2range,y2range,z2,realm); // search for multis. this is tricky, since the center might lie outside the box - WorldIterator<MultiFilter>::InBox( x1, y1, x2, y2, realm, [&]( Multi::UMulti* multi ) + WorldIterator<MultiFilter>::InBox( x1range, y1range, x2range, y2range, realm, [&]( Multi::UMulti* multi ) { const Multi::MultiDef& md = multi->multidef(); if ( multi->x + md.minrx > x2 || // east of the box @@ -5843,4 +5860,4 @@ return function_table[idx].funcname; } } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |