Right now I just changed something myself, but I'm sure you can make it an option.
Code: Select all
action actor A_Eject(class<Actor> itemtype, double xofs = 0, double yofs = 0, double zofs = 0, double xvel = 0, double yvel = 0, double zvel = 0) {
if (!player || !player.mo || bdoom_weapons != 2)
return null;
PlayerInfo plr = player;
PlayerPawn pmo = player.mo;
Vector3 ofs = pmo.pos+(0,0,plr.viewheight-GetFloorTerrain().footclip);
Vector3 x, y, z;
[x, y, z] = Matrix4.getaxes(pmo.pitch,pmo.angle,pmo.roll);
let targofs = ofs+x*xofs+y*yofs-z*zofs;
if (!Level.IsPointInLevel(targofs))
return null;
let c = Spawn(itemtype,targofs);
if (c) {
c.vel = x*xvel+y*yvel+z*zvel;
c.target = self;
c.angle = angle;
return c;
}
return null;
}