From 3c7e06bdd37775c8f9c4d773fe5a5c4a112a5fca Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 29 Nov 2024 14:24:40 +0800 Subject: [PATCH] 1 --- server/wheelserver/mt/MapGrid.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/wheelserver/mt/MapGrid.go b/server/wheelserver/mt/MapGrid.go index dc6bbbe9..1753a011 100644 --- a/server/wheelserver/mt/MapGrid.go +++ b/server/wheelserver/mt/MapGrid.go @@ -19,6 +19,7 @@ type MapGrid struct { type MapGridTable struct { f5.IdMetaTable[MapGrid] + maxGridId int32 } func (this *MapGrid) Init1() { @@ -38,3 +39,12 @@ func (this *MapGrid) Init1() { func (this *MapGrid) GetRewardItems() *[]*MapGridRewardItem { return &this.rewardItems } + +func (this *MapGridTable) PostInit1() { + this.Traverse(func (gridMeta *MapGrid) bool { + if gridMeta.GetId() > this.maxGridId { + this.maxGridId = gridMeta.GetId() + } + return true + }) +}