aboutsummaryrefslogtreecommitdiff
path: root/engine/lib/entities.php
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib/entities.php')
-rw-r--r--engine/lib/entities.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/engine/lib/entities.php b/engine/lib/entities.php
index 1a0f78249..2121429ac 100644
--- a/engine/lib/entities.php
+++ b/engine/lib/entities.php
@@ -389,7 +389,11 @@
*
* @return string The entity subtype
*/
- public function getSubtype() { return get_subtype_from_id($this->get('subtype')); }
+ public function getSubtype() {
+ if (!((int) $this->guid > 0)) return $this->get('subtype'); // If this object hasn't been saved, then return the subtype string.
+
+ return get_subtype_from_id($this->get('subtype'));
+ }
/**
* Gets the UNIX epoch time that this entity was created