05.05.2018, 20:23
And I have no idea why.
Simple enough, should work, right?
Well, for god knows what reason the last line deletes obTown[0] object, even thought I've added IsValidDynamicObject(obTemp), and obTemp wasn't created yet. So why on earth does the last code delete obTown[0]?
Primo, the code after IsValidDynamicObject(obTemp) should not execute. Secundo, it should not even a random object when it cannot find obTemp.
Am I missing something here?
PHP Code:
// top of the gamemode
new obTown[300];
new obTemp;
// GameModeInit
obTown[0] = CreateDynamicObject(2332, 2330.5341, 2392.4895, 11.7454, 0.0000, 0.0000, 0.0000);
obTown[1] = CreateDynamicObject(8168, 2293.5983, 2370.7895, 8.1695, 0.0000, 0.0000, 16.6998); // and so on...
// somewhere else in the code
if(IsValidDynamicObject(obTemp)) DestroyDynamicObject(obTemp); // HERE IS THE PROBLEM
Well, for god knows what reason the last line deletes obTown[0] object, even thought I've added IsValidDynamicObject(obTemp), and obTemp wasn't created yet. So why on earth does the last code delete obTown[0]?
Primo, the code after IsValidDynamicObject(obTemp) should not execute. Secundo, it should not even a random object when it cannot find obTemp.
Am I missing something here?