mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-06-09 01:10:43 +00:00
* Return errors for #790 * Fixing lint issues * Returning nil instead of empty struct pointer * Removed new hero stat calls as new player requires stats to be passed in. These were using defaults regardless of the save file. * Removed override on the default to health/mana/experience. These should now result is proper values. * Removed new hero stat calls as new player requires stats to be passed in. These were using defaults regardless of the save file. * Removed override on the default to health/mana/experience. These should now result is proper values.
This commit is contained in:
parent
2c6c54acce
commit
4dd69e7709
|
@ -55,10 +55,5 @@ func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStat
|
||||||
result.Health = result.MaxHealth
|
result.Health = result.MaxHealth
|
||||||
result.Stamina = float64(result.MaxStamina)
|
result.Stamina = float64(result.MaxStamina)
|
||||||
|
|
||||||
// https://github.com/OpenDiablo2/OpenDiablo2/issues/815
|
|
||||||
result.Health = 50
|
|
||||||
result.Mana = 30
|
|
||||||
result.Experience = 166
|
|
||||||
|
|
||||||
return &result
|
return &result
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,9 +86,7 @@ func (f *MapEntityFactory) NewPlayer(id, name string, x, y, direction int, heroT
|
||||||
stats.NextLevelExp = f.asset.Records.GetExperienceBreakpoint(heroType, stats.Level)
|
stats.NextLevelExp = f.asset.Records.GetExperienceBreakpoint(heroType, stats.Level)
|
||||||
stats.Stamina = float64(stats.MaxStamina)
|
stats.Stamina = float64(stats.MaxStamina)
|
||||||
|
|
||||||
defaultCharStats := f.asset.Records.Character.Stats[heroType]
|
heroState, _ := f.CreateHeroState(name, heroType, stats)
|
||||||
statsState := f.HeroStateFactory.CreateHeroStatsState(heroType, defaultCharStats)
|
|
||||||
heroState, _ := f.CreateHeroState(name, heroType, statsState)
|
|
||||||
|
|
||||||
result := &Player{
|
result := &Player{
|
||||||
mapEntity: newMapEntity(x, y),
|
mapEntity: newMapEntity(x, y),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user