Skip to content

Commit

Permalink
v0.5.2
Browse files Browse the repository at this point in the history
-------

Change:

- FixBrokenDamageRefItemContainer will not automate delete invalid on EquipItemContainerId and ItemContainerId
  • Loading branch information
magicbear committed Feb 10, 2024
1 parent 03a6125 commit 5e7263c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ Changelog
Note that they these tags will not actually close the issue/PR until they
are merged into the "default" branch.

v0.5.2
-------

Change:

- FixBrokenDamageRefItemContainer will not automate delete invalid on EquipItemContainerId and ItemContainerId

v0.5.1
-------

Expand Down
25 changes: 13 additions & 12 deletions palworld_server_toolkit/editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -2728,11 +2728,11 @@ def FindDamageRefItemContainer():
for character in wsd['CharacterSaveParameterMap']['value']:
characterData = character['value']['RawData']['value']['object']['SaveParameter']['value']
# Ignored for Boss, Boss will have empty EquipItemContainerId but work
# if 'EquipItemContainerId' in characterData:
# if characterData['EquipItemContainerId']['value']['ID']['value'] not in MappingCache.ItemContainerSaveData:
# InvalidObjects['Character']['EquipItemContainerId'].append(character['key']['InstanceId']['value'])
# print(f"%-60s {character['key']['InstanceId']['value']} -> EqualItemContainerID {characterData['EquipItemContainerId']['value']['ID']['value']} Invalid" %
# CharacterDescription(character))
if 'EquipItemContainerId' in characterData:
if characterData['EquipItemContainerId']['value']['ID']['value'] not in MappingCache.ItemContainerSaveData:
InvalidObjects['Character']['EquipItemContainerId'].append(character['key']['InstanceId']['value'])
print(f"%-60s {character['key']['InstanceId']['value']} -> EqualItemContainerID {characterData['EquipItemContainerId']['value']['ID']['value']} Invalid" %
CharacterDescription(character))
if 'ItemContainerId' in characterData:
if characterData['ItemContainerId']['value']['ID']['value'] not in MappingCache.ItemContainerSaveData:
InvalidObjects['Character']['ItemContainerId'].append(character['key']['InstanceId']['value'])
Expand All @@ -2741,22 +2741,23 @@ def FindDamageRefItemContainer():
for mapObject in parse_item(wsd['MapObjectSaveData'], 'MapObjectSaveData')['value']['values']:
for concrete in mapObject['ConcreteModel']['value']['ModuleMap']['value']:
if concrete['key'] == "EPalMapObjectConcreteModelModuleType::ItemContainer":
if concrete['value']['RawData']['value'][
'target_container_id'] not in MappingCache.ItemContainerSaveData:
if concrete['value']['RawData']['value']['target_container_id'] not in MappingCache.ItemContainerSaveData:
InvalidObjects['MapObject'].append(mapObject['MapObjectInstanceId']['value'])
print(
f"MapObject {mapObject['MapObjectInstanceId']['value']} -> ItemContainer {concrete['value']['RawData']['value']['target_container_id']} Invalid")
return InvalidObjects


def FixBrokenDamageRefItemContainer():
def FixBrokenDamageRefItemContainer(withInvalidEqualItemContainer=False, withInvalidItemContainer=False):
BrokenObjects = FindDamageRefItemContainer()

BatchDeleteMapObject(BrokenObjects['MapObject'])
# for characterId in BrokenObjects['Character']['EquipItemContainerId']:
# DeleteCharacter(characterId)
for characterId in BrokenObjects['Character']['ItemContainerId']:
DeleteCharacter(characterId)
if withInvalidEqualItemContainer:
for characterId in BrokenObjects['Character']['EquipItemContainerId']:
DeleteCharacter(characterId)
if withInvalidItemContainer:
for characterId in BrokenObjects['Character']['ItemContainerId']:
DeleteCharacter(characterId)
for characterId in BrokenObjects['Character']['SaveContainers']:
DeleteCharacter(characterId)
MappingCache.LoadGroupSaveDataMap()
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = palworld-server-toolkit
version = 0.5.1
version = 0.5.2
author = MagicBear
author_email = magicbearmo@gmail.com
description = A toolset for PalWorld Server
Expand Down

0 comments on commit 5e7263c

Please sign in to comment.