调整场景相关协议组的顺序

This commit is contained in:
huangxiaolei
2022-12-08 15:21:54 +08:00
parent 7384fca483
commit b836c0f8db
9 changed files with 363 additions and 218 deletions
+4 -1
View File
@@ -222,7 +222,10 @@ func (g *GameManager) UpdateStamina(player *model.Player, staminaCost int32) {
// SetStamina 设置玩家的耐力
func (g *GameManager) SetStamina(player *model.Player, stamina uint32) {
prop := constant.PlayerPropertyConst.PROP_CUR_PERSIST_STAMINA
// 当前无变动不要频繁发包
if player.PropertiesMap[constant.PlayerPropertyConst.PROP_MAX_STAMINA] == player.PropertiesMap[constant.PlayerPropertyConst.PROP_CUR_PERSIST_STAMINA] {
return
}
// 设置玩家的耐力prop
player.PropertiesMap[prop] = stamina