Cell and heart saving bug fix.

This commit is contained in:
Steve 2018-03-01 22:30:33 +00:00
parent 7037b40c7b
commit eb6e653837
8 changed files with 31 additions and 16 deletions

View File

@ -100,7 +100,8 @@ enum
ET_ENEMY, ET_ENEMY,
ET_TEEKA, ET_TEEKA,
ET_BOSS, ET_BOSS,
ET_HEART_CELL, ET_HEART,
ET_CELL,
ET_KEY, ET_KEY,
ET_ITEM, ET_ITEM,
ET_CONSUMABLE, ET_CONSUMABLE,

View File

@ -28,7 +28,7 @@ Entity *initCell(void)
i = (Item*)createItem(); i = (Item*)createItem();
i->type = ET_HEART_CELL; i->type = ET_CELL;
i->isMissionTarget = 1; i->isMissionTarget = 1;

View File

@ -29,7 +29,7 @@ Entity *initHeart(Entity *e)
i = (Item*)createItem(); i = (Item*)createItem();
i->type = ET_HEART_CELL; i->type = ET_HEART;
i->isMissionTarget = 1; i->isMissionTarget = 1;

View File

@ -255,14 +255,25 @@ static void save(cJSON *root)
i = (Item*)self; i = (Item*)self;
if (i->type != ET_KEY) switch (i->type)
{
cJSON_AddStringToObject(root, "type", "Item");
}
else
{ {
case ET_KEY:
cJSON_AddStringToObject(root, "type", i->sprite[0]->name); cJSON_AddStringToObject(root, "type", i->sprite[0]->name);
break;
case ET_HEART:
cJSON_AddStringToObject(root, "type", "Heart");
break;
case ET_CELL:
cJSON_AddStringToObject(root, "type", "Cell");
break;
default:
cJSON_AddStringToObject(root, "type", "Item");
break;
} }
cJSON_AddNumberToObject(root, "canBeCarried", i->canBeCarried); cJSON_AddNumberToObject(root, "canBeCarried", i->canBeCarried);
cJSON_AddNumberToObject(root, "canBePickedUp", i->canBePickedUp); cJSON_AddNumberToObject(root, "canBePickedUp", i->canBePickedUp);
cJSON_AddNumberToObject(root, "isMissionTarget", i->isMissionTarget); cJSON_AddNumberToObject(root, "isMissionTarget", i->isMissionTarget);

View File

@ -235,7 +235,7 @@ static int getPostMissionStatus(void)
{ {
for (e = world.entityHead.next ; e != NULL ; e = e->next) for (e = world.entityHead.next ; e != NULL ; e = e->next)
{ {
if (e->type == ET_HEART_CELL) if (e->type == ET_HEART || e->type == ET_CELL)
{ {
return MS_MISSING_HEART_CELL; return MS_MISSING_HEART_CELL;
} }

View File

@ -24,12 +24,12 @@ void initAtlasTest(void)
{ {
int test; int test;
dev.debug = 0; dev.debug = 1;
dev.cheatStatic = 0; dev.cheatStatic = 0;
dev.cheatBlind = 1; dev.cheatBlind = 1;
dev.cheatNoEnemies = 0; dev.cheatNoEnemies = 0;
dev.cheatKeys = 0; dev.cheatKeys = 0;
dev.cheatPower = 0; dev.cheatPower = 1;
dev.cheatHealth = 0; dev.cheatHealth = 0;
dev.cheatLevels = 0; dev.cheatLevels = 0;
dev.takeScreenshots = 0; dev.takeScreenshots = 0;

View File

@ -175,7 +175,7 @@ static int isMissingHeartCell(char *targetName)
{ {
if (e->alive == ALIVE_ALIVE) if (e->alive == ALIVE_ALIVE)
{ {
if (e->type == ET_HEART_CELL) if (e->type == ET_HEART || e->type == ET_CELL)
{ {
return 0; return 0;
} }

View File

@ -158,7 +158,8 @@ static void enableMarker(int type, int i)
marker[i].visible = 1; marker[i].visible = 1;
break; break;
case ET_HEART_CELL: case ET_HEART:
case ET_CELL:
case ET_KEY: case ET_KEY:
case ET_ITEM: case ET_ITEM:
case ET_DESTRUCTABLE: case ET_DESTRUCTABLE:
@ -335,7 +336,8 @@ static int isValidBlip(Entity *e)
case ET_MIA: case ET_MIA:
case ET_TEEKA: case ET_TEEKA:
case ET_BOSS: case ET_BOSS:
case ET_HEART_CELL: case ET_HEART:
case ET_CELL:
case ET_KEY: case ET_KEY:
case ET_ITEM: case ET_ITEM:
case ET_DESTRUCTABLE: case ET_DESTRUCTABLE:
@ -373,7 +375,8 @@ static void getBlipColor(Entity *e, SDL_Color *c)
break; break;
case ET_HEART_CELL: case ET_HEART:
case ET_CELL:
case ET_KEY: case ET_KEY:
case ET_ITEM: case ET_ITEM:
c->g = 168; c->g = 168;