forked from akanyan/mu3-mods
fix(UnlockMemory): crashing with broken data
You've REALLY fucked your data up if I can't even reproduce that.
This commit is contained in:
@ -22,9 +22,10 @@ class patch_PacketGetGameEvent: Packet {
|
|||||||
idPeriod.period.endDate = endDate;
|
idPeriod.period.endDate = endDate;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
idPeriod = new();
|
idPeriod = new() {
|
||||||
idPeriod.id = eventData.id;
|
id = eventData.id,
|
||||||
idPeriod.period = new Period(DateTime.MinValue.Date, endDate);
|
period = new Period(DateTime.MinValue.Date, endDate)
|
||||||
|
};
|
||||||
_gameEvent.list.Add(idPeriod);
|
_gameEvent.list.Add(idPeriod);
|
||||||
_gameEvent.lastUpdate = CustomDateTime.Now;
|
_gameEvent.lastUpdate = CustomDateTime.Now;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ class patch_PacketGetUserMemoryChapter: Packet {
|
|||||||
case State.Done: {
|
case State.Done: {
|
||||||
GetUserMemoryChapterResponse response_ = (query_ as GetUserMemoryChapter).response_;
|
GetUserMemoryChapterResponse response_ = (query_ as GetUserMemoryChapter).response_;
|
||||||
foreach(MemoryChapterData memoryChapterData in SingletonStateMachine<DataManager, DataManager.EState>.instance.allMemoryChapterData) {
|
foreach(MemoryChapterData memoryChapterData in SingletonStateMachine<DataManager, DataManager.EState>.instance.allMemoryChapterData) {
|
||||||
UserMemoryChapter userMemoryChapter = Enumerable.FirstOrDefault(response_.userMemoryChapterList, (UserMemoryChapter c) => c.chapterId == memoryChapterData.id);
|
UserMemoryChapter userMemoryChapter = Enumerable.FirstOrDefault(response_.userMemoryChapterList ?? [], (UserMemoryChapter c) => c.chapterId == memoryChapterData.id);
|
||||||
if(userMemoryChapter != null) {
|
if(userMemoryChapter != null) {
|
||||||
User.UserMemoryChapter userMemoryChapter2 = new User.UserMemoryChapter();
|
User.UserMemoryChapter userMemoryChapter2 = new User.UserMemoryChapter();
|
||||||
userMemoryChapter2.copyFrom(userMemoryChapter);
|
userMemoryChapter2.copyFrom(userMemoryChapter);
|
||||||
|
Reference in New Issue
Block a user