EDIT:
Code: Select all
Actor Z_FloorCheck
{
Radius 9
Height 4
+SOLID
States
{
Spawn:
TNT1 A 1
Stop
}
}
Code: Select all
// player is on ground
Function int CheckPlayerOnGround(void)
{
int onground;
if(GetActorZ (0) == GetActorFloorZ (0) || GetActorVelZ(0) == 0 && !Spawn("Z_FloorCheck", GetActorX(0), GetActorY(0), GetActorZ(0) - (4 << 16), 0, GetActorAngle(0)))
{
onground = 1;
//Setfont("smallfont");
//print(s: "on ground");
}
else
{
onground = 0;
//Setfont("smallfont");
//print(s: "in air");
}
return onground;
}
Unfortunately this is all I can give for now. An isolated example file might take a while to make but I'm pretty sure the changes in here are making this happen.
EDIT 2: Oh hey I just remembered I have a small ZDoom-compatible project that uses the same code as what I'm describing above. So it's easy to test right away:
https://dl.dropboxusercontent.com/u/47355875/house.pk3
Jump and you will never fall down.