mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-21 23:45:20 +02:00
Fix the position-based selector of !set
Broken since the addition of !set in 7ae5eaab79
.
This commit is contained in:
@@ -349,7 +349,15 @@ AnyType CommandInterface::tptS_set(std::deque<String> * words)
|
|||||||
ui::Point tempPoint = ((PointType)selector).Value();
|
ui::Point tempPoint = ((PointType)selector).Value();
|
||||||
if(tempPoint.X<0 || tempPoint.Y<0 || tempPoint.Y >= YRES || tempPoint.X >= XRES)
|
if(tempPoint.X<0 || tempPoint.Y<0 || tempPoint.Y >= YRES || tempPoint.X >= XRES)
|
||||||
throw GeneralException("Invalid position");
|
throw GeneralException("Invalid position");
|
||||||
|
auto r = sim->pmap[tempPoint.Y][tempPoint.X];
|
||||||
|
if (!r)
|
||||||
|
{
|
||||||
|
r = sim->photons[tempPoint.Y][tempPoint.X];
|
||||||
|
}
|
||||||
|
if (r)
|
||||||
|
{
|
||||||
|
partIndex = ID(r);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
partIndex = ((NumberType)selector).Value();
|
partIndex = ((NumberType)selector).Value();
|
||||||
|
Reference in New Issue
Block a user