From 29376a9f01db3480a3c3068e64573e65c48bd0a5 Mon Sep 17 00:00:00 2001
From: mszczepa <marin.szczepanski@inria.fr>
Date: Wed, 18 May 2022 10:06:58 +0200
Subject: [PATCH] Can't use templace_swi in else block

---
 levels/interrupteurs/Makefile | 10 +++++-----
 levels/interrupteurs/main.c   |  2 +-
 levels/interrupteurs/map.c    |  4 +---
 3 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/levels/interrupteurs/Makefile b/levels/interrupteurs/Makefile
index 0df98cd3..0d7a136a 100644
--- a/levels/interrupteurs/Makefile
+++ b/levels/interrupteurs/Makefile
@@ -1,11 +1,11 @@
 MAINPROG := main
 OBJECTS := main.o map.o action.o common.o events.o events_map.o read_input.o
 
-DEFINES := -Dtemplate -Dinverse_xy -Dstring_comparison
-# DEFINES := -Dstack_alloc -Dinverse_xy -Dstring_comparison
-# DEFINES := -Dinverse_xy -Dstring_comparison
-# DEFINES := -Dstring_comparison
-# DEFINES :=
+#DEFINES := -Dtemplate -Dinverse_xy -Dstring_comparison
+#DEFINES := -Dstack_alloc -Dinverse_xy -Dstring_comparison
+#DEFINES := -Dinverse_xy -Dstring_comparison
+#DEFINES := -Dstring_comparison
+DEFINES :=
 
 CC := clang
 CFLAGS := -g -Wall -Wextra $(DEFINES)
diff --git a/levels/interrupteurs/main.c b/levels/interrupteurs/main.c
index 2c41c2b5..5d10a7c7 100644
--- a/levels/interrupteurs/main.c
+++ b/levels/interrupteurs/main.c
@@ -4,7 +4,7 @@
  * level_number: 1107
  * available_commands: next step continue
  * map_height: 7
- * map_width: 21
+ * map_width: 10
  * 
  * BUG: todo interrupteur
  * tag: todo interrupteur
diff --git a/levels/interrupteurs/map.c b/levels/interrupteurs/map.c
index b46e1992..2572430a 100644
--- a/levels/interrupteurs/map.c
+++ b/levels/interrupteurs/map.c
@@ -13,9 +13,7 @@ interactable * create_switch(int x, int y, int n) {
     #ifdef template
     swi = &template_swi; /* copy template */
     #else
-    *swi = template_swi; /* copy template */
-    // @AGDB alternatively, just set the state field
-    // swi->state = DEACTIVATED;
+    swi->state = DEACTIVATED;
     #endif
     swi->x = x;
     swi->y = y;
-- 
GitLab