Commit fdbc12dd authored by Toussaint Etienne's avatar Toussaint Etienne
Browse files

Fix my mistakes / Hitboxed repatched

parent dccc6beb
......@@ -55,7 +55,8 @@ public class AbilityEvent implements ClientEvent,ServerEvent {
}
return true;
} catch (EntityNotFoundExeption entityNotFoundExeption) {
return true;
entityNotFoundExeption.printStackTrace();
return false;
}
}
......
......@@ -16,6 +16,7 @@ public class AddedTriggerEvent implements ClientEvent{
try {
e = gameContent.getGameState().getEntity(targetID);
} catch (EntityNotFoundExeption entityNotFoundExeption) {
entityNotFoundExeption.printStackTrace();
return false;
}
if(e.addTriggers(trigger)){
......
......@@ -15,6 +15,7 @@ public class RemovedTriggerEvent implements ClientEvent{
try {
e = gameContent.getGameState().getEntity(targetID);
} catch (EntityNotFoundExeption entityNotFoundExeption) {
entityNotFoundExeption.printStackTrace();
return false;
}
if(e.removeTriggers(triggerID)){
......
......@@ -338,7 +338,8 @@ public class Entity implements Serializable{
* @param gameState
*/
boolean hackGamestate(GameState gameState) {
throw new IllegalStateException("The gamestate doesn't know the given subclass");
//throw new IllegalStateException("The gamestate doesn't know the given subclass");
return gameState.addEntityBis(this);
}
public void checkTrigger(GameContent gameContent, NetworkConnection<NetworkObject> networkConnection) {
......
......@@ -52,7 +52,11 @@ public class GameState implements Serializable{
* @return true if it was added, false otherwise.
*/
public boolean addEntity(Entity entity){
//return entity.hackGamestate(this);
return entity.hackGamestate(this);
//return entities.add(entity);
}
public boolean addEntityBis(Entity entity) {
return entities.add(entity);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment