Skip to content

Commit

Permalink
Fix sling disappearing between levels.
Browse files Browse the repository at this point in the history
Overall bootstrap logic should be a little more sane now.
  • Loading branch information
caligari87 committed Oct 13, 2018
1 parent bb0f733 commit f9236e9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/sling/bootstrap.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ class UaS_Sling_Bootstrap : EventHandler {
//initialize additional player inventory
override void PlayerEntered(PlayerEvent e) {
PlayerInfo player = players[e.PlayerNumber];
if(UaS_SlingEnabled == true && UaS_SlingStart == true) {
if(!player.mo.countinv("SlingInitialized")) {
player.mo.giveinventory("UaS_WeaponSling", 1);
}
}
else {
if(!UaS_SlingEnabled) {
player.mo.TakeInventory("SlingInitialized", 1);
player.mo.TakeInventory("UaS_WeaponSling", 1);
return;
}
if(player.mo.countinv("SlingInitialized")) { return; }
if(UaS_SlingStart == true) {
player.mo.Giveinventory("UaS_WeaponSling", 1);
}
player.mo.GiveInventory("SlingInitialized", 1);
}

override void WorldThingSpawned(WorldEvent e) {
Expand Down

0 comments on commit f9236e9

Please sign in to comment.