mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-19 06:31:26 +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();
|
||||
if(tempPoint.X<0 || tempPoint.Y<0 || tempPoint.Y >= YRES || tempPoint.X >= XRES)
|
||||
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
|
||||
partIndex = ((NumberType)selector).Value();
|
||||
|
Reference in New Issue
Block a user