From 23d07141bd41b42cd90b47d8619a07e3aa1b03a8 Mon Sep 17 00:00:00 2001
From: Allen Webster <editor@4coder.net>
Date: Sun, 12 Nov 2017 14:15:11 -0500
Subject: [PATCH] fixed app.step == 0 protection

---
 platform_linux/linux_4ed.cpp | 7 +++++--
 platform_mac/mac_4ed.cpp     | 6 ++++--
 platform_win32/win32_4ed.cpp | 6 ++++--
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/platform_linux/linux_4ed.cpp b/platform_linux/linux_4ed.cpp
index afeacddb..543f5553 100644
--- a/platform_linux/linux_4ed.cpp
+++ b/platform_linux/linux_4ed.cpp
@@ -1733,10 +1733,13 @@ main(int argc, char **argv){
             b32 keep_running = linuxvars.keep_running;
             
             // NOTE(allen): Application Core Update
-            if (app.step == 0){
-                LOG("app.step == 0 -- skipping\n");
+            if (app.step != 0){
                 app.step(&sysfunc, &target, &memory_vars, &linuxvars.input, &result);
             }
+            else{
+                LOG("app.step == 0 -- skipping\n");
+            }
+            
             
             // NOTE(allen): Finish the Loop
             if (result.perform_kill){
diff --git a/platform_mac/mac_4ed.cpp b/platform_mac/mac_4ed.cpp
index 05ffb744..5ef23938 100644
--- a/platform_mac/mac_4ed.cpp
+++ b/platform_mac/mac_4ed.cpp
@@ -524,10 +524,12 @@ osx_step(void){
     b32 keep_running = osxvars.keep_running;
     
     // NOTE(allen): Application Core Update
-    if (app.step == 0){
-        LOG("app.step == 0 -- skipping\n");
+    if (app.step != 0){
         app.step(&sysfunc, &target, &memory_vars, &frame_input, &result);
     }
+    else{
+        LOG("app.step == 0 -- skipping\n");
+    }
     
     // NOTE(allen): Finish the Loop
     if (result.perform_kill){
diff --git a/platform_win32/win32_4ed.cpp b/platform_win32/win32_4ed.cpp
index 242128a6..99d53918 100644
--- a/platform_win32/win32_4ed.cpp
+++ b/platform_win32/win32_4ed.cpp
@@ -1359,10 +1359,12 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdS
         }
         
         // NOTE(allen): Application Core Update
-        if (app.step == 0){
-            LOG("app.step == 0 -- skipping\n");
+        if (app.step != 0){
             app.step(&sysfunc, &target, &memory_vars, &input, &result);
         }
+        else{
+            LOG("app.step == 0 -- skipping\n");
+        }
         
         // NOTE(allen): Finish the Loop
         if (result.perform_kill){