Skip to content

Commit

Permalink
LemonUtil: Add missing Lock Checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Lemon-King committed Feb 7, 2024
1 parent e9790ff commit 0e90179
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions resources/assets/zscript/lib/lemonutil.zs
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,48 @@ class LemonUtil {
return mode;
}

static int GetLineLockNumber(Line l) {
if ( !l.locknumber ) {
// check the special
switch ( l.special ) {
case FS_Execute:
return l.Args[2];
break;
case Door_LockedRaise:
case Door_Animated:
return l.Args[3];
break;
case ACS_LockedExecute:
case ACS_LockedExecuteDoor:
case Generic_Door:
return l.Args[4];
break;
}
}
return l.locknumber;
}

static void ChangeLineLockNumber(Line l, int newLockNumber) {
if ( !l.locknumber ) {
// check the special
switch ( l.special ) {
case FS_Execute:
//l.Args[2] = newLockNumber;
break;
case Door_LockedRaise:
case Door_Animated:
//l.Args[3] = newLockNumber;
break;
case ACS_LockedExecute:
case ACS_LockedExecuteDoor:
case Generic_Door:
//l.Args[4] = newLockNumber;
break;
}
}
//l.locknumber = newLockNumber;
}

// CVAR user / server null safe get/find
static cvar GetCVAR(string name, PlayerInfo player = null) {
return player ? CVar.GetCvar(name, player) : CVar.FindCVar(name);
Expand Down

0 comments on commit 0e90179

Please sign in to comment.