From 5bd22ca864c9cf19b87fb2ebf99ac736384063d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 6 Sep 2009 21:22:07 +0000 Subject: [PATCH] - backported some changes from GZDoom: - fixed: Floor and ceiling hugger projectiles should not be spawned with ONFLOORZ or ONCEILINGZ because that will make them ignore the actual floor height if it differs from the sector's floor. - fixed: Floor and ceiling huggers spawned by a player did not get their vertical velocity set to 0. - some sidenum related changes in inactive 3D floor code. SVN r1802 (trunk) --- src/g_shared/a_decals.cpp | 2 +- src/p_3dfloors.cpp | 6 +++--- src/p_mobj.cpp | 16 +++++++--------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/g_shared/a_decals.cpp b/src/g_shared/a_decals.cpp index a4de80938..77c036ba8 100644 --- a/src/g_shared/a_decals.cpp +++ b/src/g_shared/a_decals.cpp @@ -291,7 +291,7 @@ FTextureID DBaseDecal::StickToWall (side_t *wall, fixed_t x, fixed_t y, F3DFloor } else { - tex = sides[ffloor->master->sidenum[0]].GetTexture(side_t::mid); + tex = ffloor->master->sidedef[0]->GetTexture(side_t::mid); } } #endif diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index f837dc0fa..13df142a7 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -210,7 +210,7 @@ static int P_Set3DFloor(line_t * line, int param,int param2, int alpha) // if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough if ((param2&128) && !(flags & FF_SOLID)) flags |= FF_FLOOD|FF_SEETHROUGH|FF_SHOOTTHROUGH; if (param2&512) flags |= FF_FADEWALLS; - FTextureID tex = sides[line->sidenum[0]].GetTexture(side_t::top); + FTextureID tex = line->sidedef[0]->GetTexture(side_t::top); if (!tex.Exists() && alpha<255) { alpha=clamp(-tex.GetIndex(), 0, 255); @@ -222,8 +222,8 @@ static int P_Set3DFloor(line_t * line, int param,int param2, int alpha) P_Add3DFloor(ss, sec, line, flags, alpha); } // To be 100% safe this should be done even if the alpha by texture value isn't used. - if (!sides[line->sidenum[0]].GetTexture(side_t::top).isValid()) - sides[line->sidenum[0]].SetTexture(side_t::top, FNullTextureID()); + if (!line->sidedef[0]->GetTexture(side_t::top).isValid()) + line->sidedef[0]->SetTexture(side_t::top, FNullTextureID()); return 1; } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 3968f4201..3ce2a8ca2 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5086,14 +5086,6 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, i = GetDefaultByType (type)->flags3; - if (i & MF3_FLOORHUGGER) - { - z = ONFLOORZ; - } - else if (i & MF3_CEILINGHUGGER) - { - z = ONCEILINGZ; - } if (z != ONFLOORZ && z != ONCEILINGZ) { // Doom spawns missiles 4 units lower than hitscan attacks for players. @@ -5127,7 +5119,13 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z, MissileActor->velx = FixedMul (vx, speed); MissileActor->vely = FixedMul (vy, speed); - MissileActor->velz = FixedMul (vz, speed); + if (th->flags3 & (MF3_FLOORHUGGER|MF3_CEILINGHUGGER)) + { + MissileActor->velz = 0; + } + else + { + MissileActor->velz = FixedMul (vz, speed); if (MissileActor->flags4 & MF4_SPECTRAL) MissileActor->health = -1;