fixes #5970, prevents bugs in the future

this is not an issue at the moment but will become one should maxHealth ever get changed.
Merge pull request #5973 from Walter0o/robot_fix

fixes #5970, prevents bugs in the future