small code cleanup
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good

This commit is contained in:
austin 2025-05-11 15:32:15 -04:00
parent d733b3c46f
commit 9156844657

View File

@ -44,7 +44,6 @@ public class CharaSimulation {
*/ */
protected static void checkForShelter(Realm realm, Character chara){ protected static void checkForShelter(Realm realm, Character chara){
MacroData macroData = realm.getMacroData(); MacroData macroData = realm.getMacroData();
// for(Character chara : Globals.macroData.getAliveCharacters()){
/* /*
If doesnt have shelter, check if in town If doesnt have shelter, check if in town
If in town, If in town,
@ -68,16 +67,6 @@ public class CharaSimulation {
shelter.setRepairable(false); shelter.setRepairable(false);
} }
} }
// Vector2i charPos = CharacterUtils.getDiscretePosition(chara);
// Town nearbyTown = Town.getTownAtPosition(charPos.x,charPos.y);
// if(nearbyTown != null){
// //if town has a place to stay
// if(false){
// } else {
// //try to find a place to put down a structure
// }
} else { } else {
Vector3d position = chara.getPos(); Vector3d position = chara.getPos();
StructureData structureData = Globals.gameConfigCurrent.getStructureData().getTypes().iterator().next(); StructureData structureData = Globals.gameConfigCurrent.getStructureData().getTypes().iterator().next();
@ -93,35 +82,7 @@ public class CharaSimulation {
//target the struct //target the struct
CharacterGoal.setCharacterGoal(chara, new CharacterGoal(CharacterGoalType.BUILD_STRUCTURE, struct)); CharacterGoal.setCharacterGoal(chara, new CharacterGoal(CharacterGoalType.BUILD_STRUCTURE, struct));
// //cry
// //TODO: Get building type to place
// String buildingTypeToPlace = "building1";
// //try to find a place to put down a structure
// // int dynamicInterpRatio = Globals.serverTerrainManager.getDynamicInterpolationRatio();
// // Vector2f placementPos = new Vector2f(
// // (float)(charPos.x * dynamicInterpRatio + Math.random() * dynamicInterpRatio),
// // (float)(charPos.y * dynamicInterpRatio + Math.random() * dynamicInterpRatio)
// // );
// // int attempts = 0;
// // while(!VirtualStructureUtils.validStructurePlacementPosition(placementPos.x, placementPos.y, buildingTypeToPlace)){
// // placementPos = new Vector2f(
// // (float)(charPos.x * dynamicInterpRatio + Math.random() * dynamicInterpRatio),
// // (float)(charPos.y * dynamicInterpRatio + Math.random() * dynamicInterpRatio)
// // );
// // attempts++;
// // if(attempts > MAX_PLACE_ATTEMPTS){
// // placementPos = null;
// // break;
// // }
// // }
// // if(placementPos != null){
// // // Structure placedStructure = VirtualStructureUtils.placeStructureAtPoint(placementPos.x, placementPos.y, buildingTypeToPlace);
// // // CharacterUtils.addShelter(chara, placedStructure);
// // // VirtualStructureUtils.addResident(placedStructure, chara);
// // }
// }
} }
// }
} }
protected static void checkTownMembership(Character chara){ protected static void checkTownMembership(Character chara){