Check if an AI is being used
Signed-off-by: Chris Cromer <chris@cromer.cl>
This commit is contained in:
parent
718943d54d
commit
e820ad1a79
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2019 Chris Cromer
|
* Copyright 2020 Chris Cromer
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
*
|
*
|
||||||
@ -118,7 +118,9 @@ public class Key extends Object implements Constants {
|
|||||||
getCell().setObjectOnBottom(null);
|
getCell().setObjectOnBottom(null);
|
||||||
setState(State.HELD);
|
setState(State.HELD);
|
||||||
try {
|
try {
|
||||||
getScene().getCanvas().getPlayer().getAi().removeKeyDestination(getCell().getX(), getCell().getY());
|
if (getScene().getCanvas().getPlayer().getAi() != null) {
|
||||||
|
getScene().getCanvas().getPlayer().getAi().removeKeyDestination(getCell().getX(), getCell().getY());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (AIException e) {
|
catch (AIException e) {
|
||||||
getLogger().warning(e.getMessage());
|
getLogger().warning(e.getMessage());
|
||||||
|
Loading…
Reference in New Issue
Block a user