Fixed an issue where thing positions were modified even when the new position was the same as the old one. Fixes #644

This commit is contained in:
biwa 2021-10-25 00:32:10 +02:00 committed by spherallic
parent 22dfd69bbf
commit b48806838d

View file

@ -416,40 +416,42 @@ namespace CodeImp.DoomBuilder.Map
// This moves the thing
// NOTE: This does not update sector! (call DetermineSector)
public void Move(Vector3D newpos)
{
if (newpos != pos)
{
BeforePropsChange();
// Change position
this.pos = newpos;
if(SRB2Type != General.Map.Config.Start3DModeThingType)
if (SRB2Type != General.Map.Config.Start3DModeThingType)
General.Map.IsChanged = true;
}
}
// This moves the thing
// NOTE: This does not update sector! (call DetermineSector)
public void Move(Vector2D newpos)
{
Vector3D p = new Vector3D(newpos.x, newpos.y, pos.z);
if (p != pos)
{
BeforePropsChange();
// Change position
this.pos = new Vector3D(newpos.x, newpos.y, pos.z);
this.pos = p;
if(SRB2Type != General.Map.Config.Start3DModeThingType)
if (SRB2Type != General.Map.Config.Start3DModeThingType)
General.Map.IsChanged = true;
}
}
// This moves the thing
// NOTE: This does not update sector! (call DetermineSector)
public void Move(float x, float y, float zoffset)
{
BeforePropsChange();
// Change position
this.pos = new Vector3D(x, y, zoffset);
if(SRB2Type != General.Map.Config.Start3DModeThingType)
General.Map.IsChanged = true;
Move(new Vector3D(x, y, zoffset));
}
// This rotates the thing