Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix selecting despawining entity #206

Merged
merged 4 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ public Object getAttributeValue(final Object obj, final String name) {
if (p != null) {
try {
return p.getValue(obj);
} catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
} catch (IllegalAccessException | IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
buehlefs marked this conversation as resolved.
Show resolved Hide resolved
// InvocationTargetException is suppressed to prevent crashes from methods that throw an exception when the value is null, e.g. getPosition();
}
}
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,11 @@ private EntityInspectorEntry[] getEntries(final Entity e) {
type = "readonly_string";
}
//TODO: this.inspectionManager.getAttributeType(e, name)
final String value = this.inspectionManager.getAttributeValue(e, name).toString();
final Object valueObject = this.inspectionManager.getAttributeValue(e, name);
String value = "null";
if (valueObject != null) {
value = valueObject.toString();
}
result.add(new EntityInspectorEntry(name, type, value, newValue -> {
this.inspectionManager.setAttributeValue(e, name, newValue);
this.playfield.drawEntities();
Expand Down
Loading