It seems that I can never get the likelihood of the crash to zero, but the chances of it happening go up with each of the following:
- Spawning my custom fire actor (or anything inheriting from "HDPuff") instead of, say, BulletPuff or nothing at all.
- Having the setorigin call reference the target's position.
- Repositioning in any way with reference to the target.
- Running a netgame.
I am completely stumped as to what might be causing it or how I could replicate this behaviour outside this extremely narrow context.
EDIT: ...I'm starting to think it's my computer. It seems I just segfaulted for no reason at all in GL mode doing something totally unrelated.
EDIT: Somehow this does not crash:
Code: Select all
...
if(!target){
target=spawn("PersistentDamager",self.pos);
target.target=master;
if(stamina>20)stamina=20;
}
setorigin(target.pos,false);
...
setorigin(pos*0+(
random(-halfrad,halfrad),
random(-halfrad,halfrad),
random(minz,maxz)
),false);
actor sp=spawn("HDFlameRed",pos);
...
This would spawn the flames around (0,0,0) on the map instead of around the player.
Maybe it's got something to do with collision? When the player is spinning to put out the fire, the playerpawn is set up to move involuntarily and if the fire actor doesn't constantly warp to the player's positon to place the flame sprite, it could end up placing it quite far away.
Neither getting rid of the custom Tick() override nor setting +nointeraction prevents the crash.
EDIT: If I replace all instances of the SMOK sprites with PUFF, I can't replicate the segfault. Doesn't fix anything, at least not after using TEXTURES to resize and translate the PUFF into something remotely resembling what it was replacing.
It seems that I can never get the likelihood of the crash to zero, but the chances of it happening go up with each of the following:
- Spawning my custom fire actor (or anything inheriting from "HDPuff") instead of, say, BulletPuff or nothing at all.
- Having the setorigin call reference the target's position.
- Repositioning in any way with reference to the target.
- Running a netgame.
I am completely stumped as to what might be causing it or how I could replicate this behaviour outside this extremely narrow context.
EDIT: ...I'm starting to think it's my computer. It seems I just segfaulted for no reason at all in GL mode doing something totally unrelated.
EDIT: Somehow this does not crash:[code]...
if(!target){
target=spawn("PersistentDamager",self.pos);
target.target=master;
if(stamina>20)stamina=20;
}
setorigin(target.pos,false);
...
setorigin(pos*0+(
random(-halfrad,halfrad),
random(-halfrad,halfrad),
random(minz,maxz)
),false);
actor sp=spawn("HDFlameRed",pos);
...[/code]This would spawn the flames around (0,0,0) on the map instead of around the player.
Maybe it's got something to do with collision? When the player is spinning to put out the fire, the playerpawn is set up to move involuntarily and if the fire actor doesn't constantly warp to the player's positon to place the flame sprite, it could end up placing it quite far away.
Neither getting rid of the custom Tick() override nor setting +nointeraction prevents the crash.
[s]EDIT: [url=https://github.com/MatthewTheGlutton/HideousDestructor/tree/50ed455fdb6dd86815d3b0baff5a1e83878c4b9a]If I replace all instances of the SMOK sprites with PUFF, I can't replicate the segfault.[/url][/s] Doesn't fix anything, at least not after using TEXTURES to resize and translate the PUFF into something remotely resembling what it was replacing.