simtr / PowderToypp

This repository has been moved to https://github.com/FacialTurd/The-Powder-Toy
https://github.com/FacialTurd/The-Powder-Toy
GNU General Public License v3.0
20 stars 12 forks source link

High element types cause crash #126

Closed pilihp64 closed 12 years ago

pilihp64 commented 12 years ago

Setting element type to a very high number is unstable (30000+). Most of them disappear but some cause crash.

simtr commented 12 years ago

Not sure why this is, it shouldn't behave any differently to TPT

jacob1 commented 12 years ago

It doesn't look like invalid elements are even deleted, I just created a fake white element ID:255, and it stayed after being unpaused

pilihp64 commented 12 years ago

Elements under 256 (but over normal elements) are white and stable, anything over can be weird colored/glow for a frame before they die (or crash the game instantly)

simtr commented 12 years ago

This has been fixes. Unused elements are now disabled and removed from the simulation. I have also fixed the cause of the crash when removing elements with invalid types (The kill_part function was trying to decrement elementCount using the invalid type as an index.)