You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenery objects with a negative removalPrice seem to return a wrong value when accessed through the plugin API, specifically they return positive values some power of two larger than the true value, almost like there is a signedness bug somewhere. For most objects this is 256, for other things like the most expensive thing I could find in a hurry (Mythological theming golden fleece) the error is 4096.
There's every chance that this is somehow user error as well, I'm very new to JS/TS.
Steps to reproduce
The code in question:
exportfunctionremovalPriceBug(): void{for(lety=0;y<map.size.y;y++){for(letx=0;x<map.size.x;x++){lettile=map.getTile(x,y);for(leti=0;i<tile.numElements;i++){letelement=tile.getElement(i);if(element.type==='small_scenery'){letscenery=objectManager.getObject("small_scenery",element.object);if(scenery.removalPrice!=0){park.postMessage("item "+scenery.identifier+" has removal price: "+scenery.removalPrice);}}}}}}
This works fine for things with a positive removal cost.
Attachments
No response
The text was updated successfully, but these errors were encountered:
Operating System
Windows 10 x64
OpenRCT2 build
OpenRCT2, v0.4.11 (18d2b5e) provided by GitHub
Base game
RollerCoaster Tycoon 2, RollerCoaster Tycoon Classic
Area(s) with this issue?
This is a development issue
Describe the issue
Scenery objects with a negative removalPrice seem to return a wrong value when accessed through the plugin API, specifically they return positive values some power of two larger than the true value, almost like there is a signedness bug somewhere. For most objects this is 256, for other things like the most expensive thing I could find in a hurry (Mythological theming golden fleece) the error is 4096.
There's every chance that this is somehow user error as well, I'm very new to JS/TS.
Steps to reproduce
The code in question:
This works fine for things with a positive removal cost.
Attachments
No response
The text was updated successfully, but these errors were encountered: