- fixed sprite indices for map spawned sprites.

This commit is contained in:
Christoph Oelckers 2022-03-20 12:08:09 +01:00
parent 3b5203132f
commit 3114059145
4 changed files with 8 additions and 0 deletions

View file

@ -157,6 +157,7 @@ TArray<DBloodActor*> SpawnActors(BloodSpawnSpriteDef& sprites)
auto sprt = &sprites.sprites[i]; auto sprt = &sprites.sprites[i];
auto actor = InsertSprite(sprt->sectp, sprt->statnum); auto actor = InsertSprite(sprt->sectp, sprt->statnum);
spawns[j++] = actor; spawns[j++] = actor;
actor->time = i;
actor->spr = sprites.sprites[i]; actor->spr = sprites.sprites[i];
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i]; if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {}; else actor->sprext = {};
@ -168,6 +169,7 @@ TArray<DBloodActor*> SpawnActors(BloodSpawnSpriteDef& sprites)
actor->xspr = sprites.xspr[i]; actor->xspr = sprites.xspr[i];
} }
} }
leveltimer = sprites.sprites.Size();
return spawns; return spawns;
} }

View file

@ -944,10 +944,12 @@ static TArray<DDukeActor*> spawnactors(SpawnSpriteDef& sprites)
auto actor = static_cast<DDukeActor*>(InsertActor(RUNTIME_CLASS(DDukeActor), sprt->sectp, sprt->statnum)); auto actor = static_cast<DDukeActor*>(InsertActor(RUNTIME_CLASS(DDukeActor), sprt->sectp, sprt->statnum));
spawns[j++] = actor; spawns[j++] = actor;
actor->spr = sprites.sprites[i]; actor->spr = sprites.sprites[i];
actor->time = i;
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i]; if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {}; else actor->sprext = {};
actor->spsmooth = {}; actor->spsmooth = {};
} }
leveltimer = sprites.sprites.Size();
return spawns; return spawns;
} }

View file

@ -76,10 +76,12 @@ static TArray<DExhumedActor*> spawnactors(SpawnSpriteDef& sprites)
auto actor = insertActor(sprt->sectp, sprt->statnum); auto actor = insertActor(sprt->sectp, sprt->statnum);
spawns[j++] = actor; spawns[j++] = actor;
actor->spr = sprites.sprites[i]; actor->spr = sprites.sprites[i];
actor->time = i;
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i]; if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {}; else actor->sprext = {};
actor->spsmooth = {}; actor->spsmooth = {};
} }
leveltimer = sprites.sprites.Size();
return spawns; return spawns;
} }

View file

@ -357,10 +357,12 @@ void spawnactors(SpawnSpriteDef& sprites)
auto sprt = &sprites.sprites[i]; auto sprt = &sprites.sprites[i];
auto actor = insertActor(sprt->sectp, sprt->statnum); auto actor = insertActor(sprt->sectp, sprt->statnum);
actor->spr = sprites.sprites[i]; actor->spr = sprites.sprites[i];
actor->time = i;
if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i]; if (sprites.sprext.Size()) actor->sprext = sprites.sprext[i];
else actor->sprext = {}; else actor->sprext = {};
actor->spsmooth = {}; actor->spsmooth = {};
} }
leveltimer = sprites.sprites.Size();
} }