GarageGames/Torque2D

ConsoleObject::addField ignores element count

jamesu opened this issue · 1 comments

Again in my code porting I spotted another bizarre bug in behavior which seems to have been there since the initial repo checkin. This time it's in https://github.com/GarageGames/Torque2D/blame/cbe96941556edada849f145f26ba46009c61bdb6/engine/source/console/consoleObject.cc#L381

Specifically it should be supplying in_elementCount to the addField call instead of just 1. The equivalent line in T3D is in https://github.com/GarageGames/Torque3D/blob/561f010f2e6411d8253d23f0cfcff794e81f60bf/Engine/source/console/consoleObject.cpp#L495

For example if you have a field on your object like: addField("splashEmitter", TypeParticleEmitterDataPtr, Offset(splashEmitterList, VehicleData), VC_NUM_SPLASH_EMITTERS);, you will only be able to set the first splashEmitterList on the object.

Also let me know if you would prefer these quick 1-line issues in a better format. I could submit a PR to fix but wont be able to do anything significant till next week at least.

That's clearly a bug. Thanks for finding these. I'm great with you submitting them just like this. I'll put a fix in for it.

If you find anything else, let me know!