From d6d88d437087faca1e10053bf778416e71858bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 1 Nov 2022 21:52:49 +0100 Subject: [PATCH] Allow selecting switch number 0 in editor again This reverts part of #5993 to allow switch number 0 to be selected again. Switch number 0 is permanently enabled, so it useful for tiles that should always be switched on. Eventually tiles that don't work with switch 0 (e.g. switch open/close tiles) should be made unplaceable and the switch number should be hidden for tiles where it doesn't have any effect (e.g. jump tiles). See #5995. --- src/game/editor/popups.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/editor/popups.cpp b/src/game/editor/popups.cpp index b1cf7884f..b1a9125cf 100644 --- a/src/game/editor/popups.cpp +++ b/src/game/editor/popups.cpp @@ -1646,7 +1646,7 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View, void *pContext) }; CProperty aProps[] = { - {"Number", pEditor->m_SwitchNum, PROPTYPE_INT_STEP, 1, 255}, + {"Number", pEditor->m_SwitchNum, PROPTYPE_INT_STEP, 0, 255}, {"Delay", pEditor->m_SwitchDelay, PROPTYPE_INT_STEP, 0, 255}, {nullptr}, }; @@ -1657,7 +1657,7 @@ int CEditor::PopupSwitch(CEditor *pEditor, CUIRect View, void *pContext) if(Prop == PROP_SwitchNumber) { - pEditor->m_SwitchNum = (NewVal - 1 + 255) % 255 + 1; + pEditor->m_SwitchNum = (NewVal + 256) % 256; } else if(Prop == PROP_SwitchDelay) {