fixed bug with reanimating killed player by CE condition
[rocksndiamonds.git] / src / libgame / gadgets.c
index c50fb32e5f0f1e3b9b8493957470499b1ed8c86a..cbe1cabc2e23200c04961b7733fa49ce4db9fa99 100644 (file)
@@ -884,7 +884,7 @@ static void HandleGadgetTags(struct GadgetInfo *gi, int first_tag, va_list ap)
 
   while (tag != GDI_END)
   {
-    switch(tag)
+    switch (tag)
     {
       case GDI_IMAGE_ID:
        gi->image_id = va_arg(ap, int);
@@ -1479,6 +1479,10 @@ static void MapGadgetExt(struct GadgetInfo *gi, boolean redraw)
   if (gi == NULL || gi->deactivated || gi->mapped)
     return;
 
+  // do not map overlay touch buttons if touch screen is not used
+  if (gi->overlay_touch_button && !runtime.uses_touch_device)
+    return;
+
   gi->mapped = TRUE;
 
   if (redraw)