存档bug
This commit is contained in:
parent
4180d78a70
commit
94e9a6cc18
@ -116,6 +116,7 @@ function ServerItemData:recoveryItem(data, maxCount)
|
|||||||
addCount = maxCount - currentCount
|
addCount = maxCount - currentCount
|
||||||
end
|
end
|
||||||
self:_addItem(data.cfg_id, addCount)
|
self:_addItem(data.cfg_id, addCount)
|
||||||
|
ServerDataManager:saveData()
|
||||||
end
|
end
|
||||||
|
|
||||||
function ServerItemData:resetVitRecoverTime()
|
function ServerItemData:resetVitRecoverTime()
|
||||||
|
|||||||
@ -22,6 +22,7 @@ function ServerGameData:init()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ServerGameData:initData()
|
function ServerGameData:initData()
|
||||||
|
self.disableSave = true
|
||||||
self:init()
|
self:init()
|
||||||
if self.distinctId == nil or self.distinctId == "" then
|
if self.distinctId == nil or self.distinctId == "" then
|
||||||
self.distinctId = LocalData:getDistinctId()
|
self.distinctId = LocalData:getDistinctId()
|
||||||
@ -87,6 +88,7 @@ function ServerGameData:initData()
|
|||||||
v:loadLocalData()
|
v:loadLocalData()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
self.disableSave = false
|
||||||
end
|
end
|
||||||
|
|
||||||
function ServerGameData:initServerData(name, path)
|
function ServerGameData:initServerData(name, path)
|
||||||
@ -106,6 +108,9 @@ function ServerGameData:getData()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function ServerGameData:saveData()
|
function ServerGameData:saveData()
|
||||||
|
if self.disableSave then
|
||||||
|
return
|
||||||
|
end
|
||||||
for k, v in pairs(self.dataMap) do
|
for k, v in pairs(self.dataMap) do
|
||||||
v:saveLocalData()
|
v:saveLocalData()
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user