mirror of
https://github.com/OpenDiablo2/OpenDiablo2
synced 2024-09-16 08:18:19 -04:00
88326b5278
* Casting a skill now plays the corresponding overlay(if any). * Prevent a crash caused by nil pointer in HeroSkill deserialization, happening when unmarshalling HeroSkill from packets as a remote client. * Add PlayerAnimationModeNone to handle some of the Skills(e.g. Paladin auras) having "" as animation mode. * Joining a game as remote client now waits for map generation to finish before rendering map or processing map entities. This is temporary hack to prevent the game from crashing due to concurrent map read & write exception. * Send CastSkill packet to other clients. Co-authored-by: Presiyan Ivanov <presiyan-ivanov@users.noreply.github.com>
16 lines
750 B
Go
16 lines
750 B
Go
package d2hero
|
|
|
|
import "github.com/OpenDiablo2/OpenDiablo2/d2core/d2asset"
|
|
|
|
// HydrateSkills will load the SkillRecord & SkillDescriptionRecord from the asset manager, using the skill ID.
|
|
// This is done to avoid serializing the whole record data of HeroSkill to a game save or network packets.
|
|
// We cant do this while unmarshalling because there is no reference to the asset manager.
|
|
func HydrateSkills(skills map[int]*HeroSkill, asset *d2asset.AssetManager) {
|
|
for skillID := range skills {
|
|
heroSkill := skills[skillID]
|
|
heroSkill.SkillRecord = asset.Records.Skill.Details[skillID]
|
|
heroSkill.SkillDescriptionRecord = asset.Records.Skill.Descriptions[heroSkill.SkillRecord.Skilldesc]
|
|
heroSkill.SkillPoints = skills[skillID].SkillPoints
|
|
}
|
|
}
|