Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConsoleObject::addField ignores element count #419

Open
jamesu opened this issue Jan 30, 2019 · 1 comment
Open

ConsoleObject::addField ignores element count #419

jamesu opened this issue Jan 30, 2019 · 1 comment

Comments

@jamesu
Copy link
Contributor

jamesu commented Jan 30, 2019

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.

@greenfire27
Copy link
Contributor

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!

greenfire27 added a commit that referenced this issue Jan 30, 2019
This fixes issue #419
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants