Closed xxshady closed 2 years ago
If you try emit invalid baseobject, it will be sent as null value and exception will be thrown for sender: Error: Unable to convert base object to MValue because it was destroyed and is now invalid
Error: Unable to convert base object to MValue because it was destroyed and is now invalid
serverside code
alt.on('test', (entity) => alt.log('received entity:', entity?.constructor.name, entity?.valid)); const veh = new alt.Vehicle('sultan', 0, 0, 0, 0, 0, 0); veh.destroy(); alt.emit('test', veh);
Event should not be sent?
No response
Windows 11
release/10.1
shared
And where is the bug here? That is the intended behaviour
Then it should be documented and the typings fixed, i think
You can add that to the typings if you want.
Description of the problem
If you try emit invalid baseobject, it will be sent as null value and exception will be thrown for sender:
Error: Unable to convert base object to MValue because it was destroyed and is now invalid
Reproduction steps
serverside code
Expected behaviour
Event should not be sent?
Additional context
No response
Operating system
Windows 11
Version
release/10.1
Scope
shared