Pryaxis / TSAPI

🛠🌳 The TShock Scaffold API enables developers to build plugins that hook directly into the Terraria game engine.
http://tshock.co/
GNU General Public License v3.0
109 stars 67 forks source link

Fix heaptile field offsets #223

Closed SignatureBeef closed 1 year ago

SignatureBeef commented 1 year ago

This allows heaptile to be used (since 1442 broke the hook), and allows worlds to be generated and loaded as intended. This previously would fail to generate worlds due to the invalid field offsets.

hakusaro commented 1 year ago

I didn't test this but I believe you, on paper. If someone else wants to test that'd be good but otherwise we should probably just merge this.

SignatureBeef commented 1 year ago

anyone had a chance to test this? mainly I'd be surprised if heaptile even works for people in gen-dev, so i think merging is a good idea, even if it's biased of me to say. I seen some comments in discord a while ago stating it was working, however the tile provider hook is currently broken in gen-dev (since 1442) so even if -heaptile was specified, the stock tiles will be used anyway, and thus would seem to work unless the tester changes code to force HeapTile to be used. once manually changed, youll also risk corruption due to the wrong offsets being used by the wall property.

at present when retesting gen-dev, im stuck at Generating jungle for 10+ minutes on windows. Other times on my osx machine, it will crash and the world list remains empty. It's important that if anyone tests this to pay close attention to the world list, or start with no worlds so its apparent. retesting this fix, i can complete and join the world.

as some may be aware, i also have a new tile provider i wish to smash in, however i would also like to move heap tile to another directory so will wait for this PR to clear first before PR'ing the new one.

drunderscore commented 1 year ago

I'll definitely try this patch more aggressively today -- like I said in Discord it feels totally correct and sane, but I didn't encounter issues on gen-dev without it... but I'm pretty sure that I must have made a mistake somewhere, so I'll check again!

SignatureBeef commented 1 year ago

I'll definitely try this patch more aggressively today -- like I said in Discord it feels totally correct and sane, but I didn't encounter issues on gen-dev without it... but I'm pretty sure that I must have made a mistake somewhere, so I'll check again!

That would be great, thanks! It definitely would have helped if I was a bit more clear about the tile hook situation to begin with as well, sorry about that.

drunderscore commented 1 year ago

Ah, I understand now... the heaptile implementation is broken on general-devel, but so was the hook to enable it, so it wasn't actually using the implementation, can confirm it's broken.

Can also confirm this properly fixes the utilization of heaptile and it's implementation!