Correct some player height checks for SRB2

This commit is contained in:
spherallic 2023-05-08 13:35:44 +02:00
parent 8a27615178
commit aac2a46e78
2 changed files with 6 additions and 4 deletions

View file

@ -718,7 +718,8 @@ namespace CodeImp.DoomBuilder.Editing
}
//41 = player's height in Doom. Is that so in all other games as well?
if (s.CeilHeight - s.FloorHeight < 41)
//Nope, standard player height is 48 in SRB2
if (s.CeilHeight - s.FloorHeight < 48)
{
General.MainWindow.DisplayStatus(StatusType.Warning, "Can't test from current position: sector is too low!");
return false;

View file

@ -191,10 +191,10 @@ namespace CodeImp.DoomBuilder.VisualModes
if(nearestsector != null)
{
int sectorheight = nearestsector.CeilHeight - nearestsector.FloorHeight;
if(sectorheight < 41)
if(sectorheight < 48)
posz = nearestsector.FloorHeight + Math.Max(16, sectorheight / 2);
else if(General.Map.VisualCamera.Position.z < nearestsector.FloorHeight + 41)
posz = nearestsector.FloorHeight + 41; // same as in doom
posz = nearestsector.FloorHeight + 48; // same as in ~~doom~~ SRB2
else if(General.Map.VisualCamera.Position.z > nearestsector.CeilHeight)
posz = nearestsector.CeilHeight - 4;
}
@ -322,7 +322,8 @@ namespace CodeImp.DoomBuilder.VisualModes
}
//41 = player's height in Doom. Is that so in all other games as well?
if(s.CeilHeight - s.FloorHeight < 41)
//Nope, standard player height is 48 in SRB2
if (s.CeilHeight - s.FloorHeight < 48)
{
General.MainWindow.DisplayStatus(StatusType.Warning, "Can't test from current position: sector is too low!");
return false;