mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
respond to code review
This commit is contained in:
parent
d8beed34d6
commit
aa1d3eb82a
4 changed files with 6 additions and 10 deletions
|
@ -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 } );
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue