shithub: rott

Download patch

ref: 5fff31774d88a35ae9fe2533e875aca2e24c7c12
parent: 7b66ef68a874d79bc64fe165d0715747d922360c
author: levesqu8 <levesqu8@msu.edu>
date: Mon Oct 16 22:15:13 EDT 2017

Revert "probable fix to ZomROTT Save crash"

This reverts commit 7b66ef68a874d79bc64fe165d0715747d922360c.

--- a/rott/rt_game.c
+++ b/rott/rt_game.c
@@ -5175,17 +5175,15 @@
     //ZomROTT Stuff
     if(enableZomROTT)
     {
-        size = sizeof(enemiesToRes.sizeOfQueue);
+        size = sizeof(int);
         SafeWrite(savehandle, &enemiesToRes.sizeOfQueue, size);
         
         int x = 0;
         node * thingToSave = enemiesToRes.head;
-        //size = sizeof();
+        size = sizeof(objtype);
         for (x = 0; x < enemiesToRes.sizeOfQueue; x++)
         {
-            objtype * itemToSave = (objtype *) thingToSave->data;
-            size = sizeof(itemToSave);
-            SafeWrite(savehandle, itemToSave, size);
+            SafeWrite(savehandle, (objtype *) thingToSave->data, size);
             thingToSave = thingToSave->next;
         }
         //SaveResurrectList(&altbuffer, &size);
@@ -5597,7 +5595,7 @@
         
         while(x < origQueueSize)
         {
-            objtype * item = malloc(size);
+            objtype * item = (objtype *) malloc(sizeof(objtype));
             
             memcpy(item, bufptr, size);