ecs/servers/game/logic/player_function_open.go

25 lines
531 B
Go

package logic
import "ecs/proto/pb"
func (this *Player) CheckFunctionOpen(funcMod pb.ModId, funcType pb.FuncType, funcId int) bool {
var functionOpen = this.manager.tables.FunctionOpen.Find2(int(funcMod), int(funcType), funcId)
if functionOpen == nil {
return true
}
var yes = true
for i := range functionOpen.UnlockType {
switch functionOpen.UnlockType[i] {
case 1:
if functionOpen.UnlockArgs[i] > 0 {
if this.RoleLevel < uint32(functionOpen.UnlockArgs[i]) {
yes = false
}
}
}
}
return yes
}