fix equip transform containing parent
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-14 21:17:44 -04:00
parent c06af65e46
commit f60d83172d
3 changed files with 16 additions and 1 deletions

View File

@ -95,6 +95,12 @@ public class ServerEquipState implements BehaviorTree {
String equipItemClass = ItemUtils.getEquipClass(inInventoryEntity); String equipItemClass = ItemUtils.getEquipClass(inInventoryEntity);
List<String> pointEquipClassList = point.getEquipClassWhitelist(); List<String> pointEquipClassList = point.getEquipClassWhitelist();
boolean itemIsInPointWhitelist = pointEquipClassList.contains(equipItemClass); boolean itemIsInPointWhitelist = pointEquipClassList.contains(equipItemClass);
if(inInventoryEntity == null){
throw new Error("In inventory entity is null!");
}
if(ItemUtils.getContainingParent(inInventoryEntity) == null){
throw new Error("Containing parent is null!");
}
if(!hasEquipped && targetIsItem && itemIsInPointWhitelist){ if(!hasEquipped && targetIsItem && itemIsInPointWhitelist){
//hydrate inventory item //hydrate inventory item
String itemType = ItemUtils.getType(inInventoryEntity); String itemType = ItemUtils.getType(inInventoryEntity);

View File

@ -398,6 +398,10 @@ public class ServerInventoryState implements BehaviorTree {
ServerInventoryState.serverRemoveItemFromInventories(existingContainer,itemEnt); ServerInventoryState.serverRemoveItemFromInventories(existingContainer,itemEnt);
} }
//set containing parent
ItemUtils.setContainingParent(itemEnt, container);
//apply transforms
if(containerType == InventoryProtocol.INVENTORY_TYPE_EQUIP){ if(containerType == InventoryProtocol.INVENTORY_TYPE_EQUIP){
ServerEquipState equipState = ServerEquipState.getEquipState(container); ServerEquipState equipState = ServerEquipState.getEquipState(container);
EquipPoint point = equipState.getEquipPoint(slotId); EquipPoint point = equipState.getEquipPoint(slotId);

View File

@ -11,9 +11,14 @@ import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
import electrosphere.engine.profiler.Profiler; import electrosphere.engine.profiler.Profiler;
import electrosphere.net.NetUtils; import electrosphere.net.NetUtils;
/**
* Engine initialization utils for testing
*/
public class EngineInit { public class EngineInit {
//The maximum number of frames to wait before failing the startup routine /**
* The maximum number of frames to wait before failing the startup routine
*/
public static final int MAX_FRAMES_TO_WAIT = 100; public static final int MAX_FRAMES_TO_WAIT = 100;
/** /**