From e52e4439886fd5e6cefb904e002ec1597964f02b Mon Sep 17 00:00:00 2001 From: Corantin H Date: Thu, 15 Sep 2022 19:31:56 +0200 Subject: [PATCH] Editor: used max int value for goto min and max coordinates --- src/game/editor/popups.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index c5418afac..b7a279035 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include "editor.h" @@ -1782,14 +1783,6 @@ int CEditor::PopupGoto(CEditor *pEditor, CUIRect View, void *pContext) View.HSplitMid(&CoordXPicker, &CoordYPicker); CoordXPicker.VSplitRight(2.f, &CoordXPicker, nullptr); - int MaxX = pEditor->m_Map.m_pGameLayer->m_Width - 1; - int MaxY = pEditor->m_Map.m_pGameLayer->m_Height - 1; - - if(pEditor->m_GotoX > MaxX) - pEditor->m_GotoX = MaxX; - if(pEditor->m_GotoY > MaxY) - pEditor->m_GotoY = MaxY; - static ColorRGBA s_Color = ColorRGBA(1, 1, 1, 0.5f); enum @@ -1800,8 +1793,8 @@ int CEditor::PopupGoto(CEditor *pEditor, CUIRect View, void *pContext) }; CProperty aProps[] = { - {"X", pEditor->m_GotoX, PROPTYPE_INT_STEP, 0, MaxX}, - {"Y", pEditor->m_GotoY, PROPTYPE_INT_STEP, 0, MaxY}, + {"X", pEditor->m_GotoX, PROPTYPE_INT_STEP, std::numeric_limits::min(), std::numeric_limits::max()}, + {"Y", pEditor->m_GotoY, PROPTYPE_INT_STEP, std::numeric_limits::min(), std::numeric_limits::max()}, {nullptr}, };