This commit is contained in:
aozhiwei 2024-03-19 20:38:51 +08:00
parent 9d8d00fe89
commit 3c791a0be8

View File

@ -216,7 +216,7 @@ func (this *team) chooseNextLeader() {
} }
func (this *team) Leave(hum common.Player) { func (this *team) Leave(hum common.Player) {
if !this.Started() { if !this.IsLock() {
if this.IsLeader(hum) { if this.IsLeader(hum) {
delete(this.memberIdHash, hum.GetAccountId()) delete(this.memberIdHash, hum.GetAccountId())
if this.GetMemberNum() > 0 { if this.GetMemberNum() > 0 {
@ -232,7 +232,7 @@ func (this *team) Leave(hum common.Player) {
} }
func (this *team) Disband() { func (this *team) Disband() {
if !this.Started() { if !this.IsLock() {
if this.GetMemberNum() < 0 { if this.GetMemberNum() < 0 {
} else { } else {
@ -244,7 +244,7 @@ func (this *team) Disband() {
} }
func (this *team) KickOut(hum common.Player, targetId string) { func (this *team) KickOut(hum common.Player, targetId string) {
if !this.Started() { if !this.IsLock() {
if this.IsLeader(hum) { if this.IsLeader(hum) {
target := this.GetMemberByAccountId(targetId) target := this.GetMemberByAccountId(targetId)
if target != nil && target != hum { if target != nil && target != hum {
@ -258,7 +258,7 @@ func (this *team) KickOut(hum common.Player, targetId string) {
} }
func (this *team) HandoverLeader(hum common.Player, targetId string) { func (this *team) HandoverLeader(hum common.Player, targetId string) {
if !this.Started() { if !this.IsLock() {
if this.IsLeader(hum) { if this.IsLeader(hum) {
target := this.GetMemberByAccountId(targetId) target := this.GetMemberByAccountId(targetId)
if target != nil && target != hum { if target != nil && target != hum {