PneumaticCraft: Repressurized

PneumaticCraft: Repressurized

43M Downloads

Crash when setting variable using $owner.

jtchris1 opened this issue ยท 3 comments

commented

Minecraft Version

1.12.2

Forge Version

1.12.2-14.23.5.2815 and 1.12.2-14.23.5.2836

Mod Version

1.12.2-0.9.3-324 and 1.12.2-0.10.3-337

Describe your problem, including steps to reproduce it

I encountered a server crash and world corruption from using a drone program in a programmable controller in a modpack. And after testing in singleplayer with just Pneumaticcraft installed on the modpack version and newest version of Pneumaticcraft I've figured out the crash is caused by having a Coordinate Operator set a variable using the owner's location using the $owner variable.
To reproduce all you need is a start piece with a coordinate operator below setting any variable, and a coordinate piece attached to the coordinate operator with $owner set as it's variable.
Pastebin of code: https://pastebin.com/Dadnhb8f
Crash Report: https://pastebin.com/K1S4u1LW

Any other comments?

The same program works as intended when placed as a drone and problem can be worked around by using $player variable.

commented

Update: actually the PC already stores the owning player name & UUID, which make everything a lot easier; I can make $owner return the owning player for Programmable Controllers too (and as for drones, the returned pos will be (0,0,0) if the owner is offline).

commented

Yeah, the Programmable Controller doesn't support the concept of an owner like drone entities do, so that's a bug. Easiest fix is to simply ignore $owner references for the PC. An alternative might be to make the PC remember the player who placed it and used that, but I'm not sure if it's worth it (and any existing PCs would need to be broken & replaced for that to work).

commented

Fixed in 0.10.4 release.