From ad833b76c885295161ced47d7a28404693910d08 Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Fri, 20 Mar 2015 11:43:01 -0700 Subject: [PATCH] fix PROP index mismatch --- libraries/entities/src/EntityItemProperties.h | 12 ++++++++++-- libraries/entities/src/ModelEntityItem.cpp | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libraries/entities/src/EntityItemProperties.h b/libraries/entities/src/EntityItemProperties.h index 469b6067a8..d821c82e89 100644 --- a/libraries/entities/src/EntityItemProperties.h +++ b/libraries/entities/src/EntityItemProperties.h @@ -96,15 +96,23 @@ enum EntityPropertyList { PROP_COLLISION_MODEL_URL, PROP_ATTRIBUTION, - // NOTE: add new properties ABOVE this line and then modify PROP_LAST_ITEM below + //////////////////////////////////////////////////////////////////////////////////////////////////// + // ATTENTION: add new properties ABOVE this line and then modify PROP_LAST_ITEM below PROP_LAST_ITEM = PROP_ATTRIBUTION, + //////////////////////////////////////////////////////////////////////////////////////////////////// + + //////////////////////////////////////////////////////////////////////////////////////////////////// + // WARNING! Do not add props here unless you intentionally mean to reuse PROP_ indexes + // // These properties of TextEntity piggy back off of properties of ModelEntities, the type doesn't matter // since the derived class knows how to interpret it's own properties and knows the types it expects PROP_TEXT_COLOR = PROP_COLOR, PROP_TEXT = PROP_MODEL_URL, PROP_LINE_HEIGHT = PROP_ANIMATION_URL, - PROP_BACKGROUND_COLOR = PROP_ANIMATION_FPS + PROP_BACKGROUND_COLOR = PROP_ANIMATION_FPS, + PROP_COLLISION_MODEL_URL_OLD_VERSION + // WARNING!!! DO NOT ADD PROPS_xxx here unless you really really meant to.... Add them UP above }; typedef PropertyFlags EntityPropertyFlags; diff --git a/libraries/entities/src/ModelEntityItem.cpp b/libraries/entities/src/ModelEntityItem.cpp index ce009988b1..a2364f9e17 100644 --- a/libraries/entities/src/ModelEntityItem.cpp +++ b/libraries/entities/src/ModelEntityItem.cpp @@ -98,6 +98,8 @@ int ModelEntityItem::readEntitySubclassDataFromBuffer(const unsigned char* data, READ_ENTITY_PROPERTY_STRING(PROP_MODEL_URL, setModelURL); if (args.bitstreamVersion < VERSION_ENTITIES_HAS_COLLISION_MODEL) { setCollisionModelURL(""); + } else if (args.bitstreamVersion < VERSION_ENTITIES_HAS_ATTRIBUTION) { + READ_ENTITY_PROPERTY_STRING(PROP_COLLISION_MODEL_URL_OLD_VERSION, setCollisionModelURL); } else { READ_ENTITY_PROPERTY_STRING(PROP_COLLISION_MODEL_URL, setCollisionModelURL); }