mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-10-11 08:18:49 -07:00
fix null growth state when hatching some dragons
This commit is contained in:
parent
fb582b4c24
commit
5e6eba3af3
@ -44,7 +44,7 @@ namespace sodoff.Services {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void DragonLevelUpOnAgeUp(Dragon dragon, RaisedPetGrowthState oldGrowthState, RaisedPetGrowthState newGrowthState) {
|
public void DragonLevelUpOnAgeUp(Dragon dragon, RaisedPetGrowthState oldGrowthState, RaisedPetGrowthState newGrowthState) {
|
||||||
if (newGrowthState.Order > oldGrowthState.Order) {
|
if (oldGrowthState is null || newGrowthState.Order > oldGrowthState.Order) {
|
||||||
// age up
|
// age up
|
||||||
int dragonXP = dragon.PetXP ?? 0;
|
int dragonXP = dragon.PetXP ?? 0;
|
||||||
if (newGrowthState.Order == 4 && dragonXP < dragonAdultMinXP) {
|
if (newGrowthState.Order == 4 && dragonXP < dragonAdultMinXP) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user