mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-23 04:57:18 +00:00
Fix setOrFetch
on 0 values
This commit is contained in:
parent
2a5c7bf75c
commit
3224bbeb4f
@ -535,9 +535,10 @@ public class Player {
|
||||
* @param defaultValue The value to apply if the property doesn't exist.
|
||||
*/
|
||||
private void setOrFetch(PlayerProperty property, int defaultValue) {
|
||||
this.setProperty(property,
|
||||
this.properties.containsKey(property.getId()) ?
|
||||
this.getProperty(property) : defaultValue, false);
|
||||
var exists = this.properties.containsKey(property.getId());
|
||||
if (exists) exists = this.getProperty(property) != 0;
|
||||
this.setProperty(property, exists ? this.getProperty(property)
|
||||
: defaultValue, false);
|
||||
}
|
||||
|
||||
public int getPrimogems() {
|
||||
|
Loading…
Reference in New Issue
Block a user