respond to code review

This commit is contained in:
Seth Alves 2015-05-20 17:31:57 -07:00
parent d8beed34d6
commit aa1d3eb82a
4 changed files with 6 additions and 10 deletions

View file

@ -106,9 +106,6 @@ function updateButterflies(deltaTime) {
var CHANCE_OF_IMPULSE = 0.04;
for (var i = 0; i < numButterflies; i++) {
if (Math.random() < CHANCE_OF_IMPULSE) {
if (!butterflies[i]) {
butterflies[i] = Entities.identifyEntity(butterflies[i]);
}
var properties = Entities.getEntityProperties(butterflies[i]);
if (Vec3.length(Vec3.subtract(properties.position, flockPosition)) > range) {
Entities.editEntity(butterflies[i], { position: flockPosition } );

View file

@ -587,6 +587,7 @@ int EntityTree::processEditPacketData(PacketType packetType, const unsigned char
qCDebug(entities) << "User [" << senderNode->getUUID() << "] adding entity.";
qCDebug(entities) << " properties:" << properties;
}
properties.setCreated(properties.getLastEdited());
EntityItem* newEntity = addEntity(entityItemID, properties);
if (newEntity) {
newEntity->markAsChangedOnServer();

View file

@ -25,11 +25,11 @@ public:
};
inline uint qHash(const EntityToMoveDetails& a, uint seed) {
return qHash(a.entity, seed);
return qHash(a.entity->getEntityItemID(), seed);
}
inline bool operator==(const EntityToMoveDetails& a, const EntityToMoveDetails& b) {
return a.entity == b.entity;
return a.entity->getEntityItemID() == b.entity->getEntityItemID();
}
class MovingEntitiesOperator : public RecurseOctreeOperator {

View file

@ -68,9 +68,9 @@ enum PacketType {
PacketTypeNodeJsonStats,
PacketTypeEntityQuery, // 40
PacketTypeEntityData,
UNUSED_11,
PacketTypeEntityAdd,
PacketTypeEntityErase,
UNUSED_12,
PacketTypeEntityEdit,
PacketTypeOctreeDataNack, // 45
PacketTypeStopNode,
PacketTypeAudioEnvironment,
@ -79,9 +79,7 @@ enum PacketType {
PacketTypeIceServerHeartbeat, // 50
PacketTypeIceServerHeartbeatResponse,
PacketTypeUnverifiedPing,
PacketTypeUnverifiedPingReply,
PacketTypeEntityAdd,
PacketTypeEntityEdit
PacketTypeUnverifiedPingReply
};
typedef char PacketVersion;