So basically, I'm trying to disable Inventory.NOSCREENFLASH on the fly with an Event Handler and its WorldThingSpawned virtual. Here's some code.
Code: Select all
if (e.thing is "Inventory")
e.thing.bNoScreenFlash = true;
The second line is problematic because I assume that bNoScreenFlash is not directly a member of Thing. So I tried prefixing it with "Inv", which the member of type Inventory in the base Actor class just for giggles like so:
Code: Select all
if (e.thing is "Inventory")
e.thing.Inv.bNoScreenFlash = true;
It no longer complains about bNoScreenFlash being an unknown identifier, but the VM crashes with an access violation (address 0).
So finally, I try to modify the check like so:
Code: Select all
if (e.thing.Inv)
e.thing.Inv.bNoScreenFlash = true;
This doesn't cause the VM to crash, but it has no effect whatsoever.
The only thing that I've done to make it work is having e.thing call A_ChangeFlag(), but as we all know, that function is deprecated.