@@ -562,31 +562,6 @@ BOOL scrGroupObjGet(UDWORD index)
562562 return false;
563563 }
564564
565- //fix: turn off caching, since it can screw up everything if returns outdated values
566- // recalculate the values if necessary
567- /*
568- if (lgGameTime != gameTime || psScrLastGroup != psGroup)
569- {
570- lgGameTime = gameTime;
571- psScrLastGroup = psGroup;
572- lgMembers = 0;
573- lgHealth = 0;
574- lgX = lgY = 0;
575- for(psCurr = psGroup->psList; psCurr; psCurr = psCurr->psGrpNext)
576- {
577- lgMembers += 1;
578- lgX += (SDWORD)psCurr->pos.x;
579- lgY += (SDWORD)psCurr->pos.y;
580- lgHealth += (SDWORD)((100 * psCurr->body)/psCurr->originalBody);
581- }
582- if (lgMembers > 0)
583- {
584- lgX = lgX / lgMembers;
585- lgY = lgY / lgMembers;
586- lgHealth = lgHealth / lgMembers;
587- }
588- }
589- */
590565 switch (index )
591566 {
592567 case GROUPID_POSX :
@@ -798,7 +773,7 @@ BOOL scrValDefSave(INTERP_VAL *psVal, char *pBuffer, UDWORD *pSize)
798773 // just save the id
799774 if (pBuffer )
800775 {
801- if (psVal -> v .oval == NULL )
776+ if (psVal -> v .oval == NULL || (( BASE_OBJECT * ) psVal -> v . oval ) -> died > 1 || ! getBaseObjFromId ((( BASE_OBJECT * ) psVal -> v . oval ) -> id ) )
802777 {
803778 * ((UDWORD * )pBuffer ) = UDWORD_MAX ;
804779 }
@@ -1197,26 +1172,8 @@ BOOL scrValDefLoad(SDWORD version, INTERP_VAL *psVal, char *pBuffer, UDWORD size
11971172 *
11981173 * Thus loading of these strings is practically impossible.
11991174 */
1200- #if 0
1201- const char * const str = strresGetString (psStringRes , id );
1202- if (!str )
1203- {
1204- debug (LOG_FATAL , "Couldn't find string with id %u" , id );
1205- abort ();
1206- return false;
1207- }
1208-
1209- psVal -> v .sval = strdup (str );
1210- if (!psVal -> v .sval )
1211- {
1212- debug (LOG_FATAL , "Out of memory" );
1213- abort ();
1214- return false;
1215- }
1216- #else
12171175 debug (LOG_ERROR , "Incompatible savegame format version %u, should be at least version 4" , (unsigned int )version );
12181176 return false;
1219- #endif
12201177 }
12211178 }
12221179 else
0 commit comments