Fix keyless achievement detection.
This commit is contained in:
parent
78f2ee97bc
commit
844a6393a4
2 changed files with 11 additions and 12 deletions
|
|
@ -1,3 +1,3 @@
|
|||
[default]
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r279 \cu(Mon 8 Aug 13:09:00 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r279 \cu(2022-08-08 13:09:00)\c-";
|
||||
SWWM_MODVER="\cyDEMOLITIONIST \cw1.3pre r280 \cu(Mon 8 Aug 13:46:32 CEST 2022)\c-";
|
||||
SWWM_SHORTVER="\cw1.3pre r280 \cu(2022-08-08 13:46:32)\c-";
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ extend Class SWWMHandler
|
|||
// for minimap
|
||||
Array<int> ffsectors;
|
||||
|
||||
Array<Class<Key> > mapkeys;
|
||||
bool maphaskeys;
|
||||
|
||||
// level end stats
|
||||
override void WorldUnloaded( WorldEvent e )
|
||||
|
|
@ -113,19 +113,18 @@ extend Class SWWMHandler
|
|||
// the playerpawn will know what to do with this in its PreTravelled()
|
||||
}
|
||||
// did we complete this map without collecting any of its keys? (doesn't work for hubs)
|
||||
if ( (mapkeys.Size() > 0) && !(level.clusterflags&LevelLocals.CLUSTER_HUB) )
|
||||
if ( maphaskeys && !(level.clusterflags&LevelLocals.CLUSTER_HUB) )
|
||||
{
|
||||
bool collected = false;
|
||||
for ( int i=0; i<mapkeys.Size(); i++ )
|
||||
for ( int i=0; i<MAXPLAYERS; i++ )
|
||||
{
|
||||
for ( int j=0; j<MAXPLAYERS; j++ )
|
||||
if ( !playeringame[i] || !players[i].mo ) continue;
|
||||
for ( Inventory inv=players[i].mo.inv; inv; inv=inv.inv )
|
||||
{
|
||||
if ( !playeringame[j] || !players[j].mo ) continue;
|
||||
if ( !players[j].mo.FindInventory(mapkeys[i]) ) continue;
|
||||
if ( !(inv is 'Key') ) continue;
|
||||
collected = true;
|
||||
break;
|
||||
}
|
||||
if ( collected ) break;
|
||||
}
|
||||
if ( !collected ) SWWMUtility.MarkAchievement("cliffyb",players[consoleplayer]);
|
||||
}
|
||||
|
|
@ -375,14 +374,14 @@ extend Class SWWMHandler
|
|||
// spawn loot
|
||||
if ( !deathmatch ) Chancebox.SpawnChanceboxes();
|
||||
// list map keys
|
||||
maphaskeys = false;
|
||||
ti = ThinkerIterator.Create("Key");
|
||||
Key k;
|
||||
while ( k = Key(ti.Next()) )
|
||||
{
|
||||
if ( k.Owner ) continue;
|
||||
if ( mapkeys.Find(k.GetClass()) < mapkeys.Size() )
|
||||
continue;
|
||||
mapkeys.Push(k.GetClass());
|
||||
maphaskeys = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue