Ticket #4045: CCmpRangeManager.cpp.patch
File CCmpRangeManager.cpp.patch, 1.5 KB (added by , 8 years ago) |
---|
-
CCmpRangeManager.cpp
170 170 */ 171 171 struct EntityData 172 172 { 173 EntityData() : visibilities(0), size(0), retainInFog(0), owner(-1), inWorld(0), flags(1), scriptedVisibility(0) {}173 EntityData() : visibilities(0), size(0), retainInFog(0), owner(-1), inWorld(0), flags(1), scriptedVisibility(0), componentCache(NULL){} 174 174 entity_pos_t x, z; 175 175 entity_pos_t visionRange; 176 176 u32 visibilities; // 2-bit visibility, per player 177 177 u32 size; 178 SEntityComponentCache* componentCache; 178 179 u8 retainInFog; // boolean 179 180 i8 owner; 180 181 u8 inWorld; // boolean … … 182 183 u8 scriptedVisibility; // boolean, see ComputeLosVisibility 183 184 }; 184 185 185 cassert(sizeof(EntityData) == 28);186 cassert(sizeof(EntityData) == 32); 186 187 187 188 /** 188 189 * Serialization helper template for Query … … 480 481 if (cmpObstruction) 481 482 entdata.size = cmpObstruction->GetSize().ToInt_RoundToInfinity(); 482 483 484 // Should never fail 485 entdata.componentCache = GetSimContext().GetComponentManager().LookupEntityHandle(ent).GetComponentCache(); 486 483 487 // Remember this entity 484 488 m_EntityData.insert(ent, entdata); 485 489 break; … … 1033 1037 return false; 1034 1038 1035 1039 // Ignore if it's missing the required interface 1036 if (q.interface && !GetSimContext().GetComponentManager().QueryInterface(id, q.interface))1040 if (q.interface && entity.componentCache->interfaces[q.interface] == NULL) 1037 1041 return false; 1038 1042 1039 1043 return true;