Load mission droid pointers, fixes bug present in ticket:2731

master
Per Inge Mathisen 2011-05-21 22:44:27 +02:00
parent 10f674077d
commit f1321b5e49
1 changed files with 4 additions and 0 deletions

View File

@ -4353,6 +4353,10 @@ static bool loadSaveDroidPointers(const QString &pFileName, DROID **ppsCurrentDr
int id = ini.value("id").toInt(); int id = ini.value("id").toInt();
for (psDroid = ppsCurrentDroidLists[player]; psDroid && psDroid->id != id; psDroid = psDroid->psNext) {} for (psDroid = ppsCurrentDroidLists[player]; psDroid && psDroid->id != id; psDroid = psDroid->psNext) {}
if (!psDroid)
{
for (psDroid = mission.apsDroidLists[player]; psDroid && psDroid->id != id; psDroid = psDroid->psNext) {}
}
ASSERT_OR_RETURN(false, psDroid, "Droid %d not found", id); ASSERT_OR_RETURN(false, psDroid, "Droid %d not found", id);
for (int j = 0; j < DROID_MAXWEAPS; j++) for (int j = 0; j < DROID_MAXWEAPS; j++)