修复ammo.get NPE

This commit is contained in:
Light_Quanta 2025-04-15 23:25:48 +08:00
parent 9ff7abfd34
commit e44c46dc3b
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -101,7 +101,7 @@ public enum Ammo {
// PlayerVariables
public int get(PlayerVariable variable) {
return variable.ammo.get(this);
return variable.ammo.getOrDefault(this, 0);
}
public void set(PlayerVariable variable, int count) {