Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 826 vs 827 for /trunk/Source Code/Dynamics/Entities/Units/Unit.cpp

Diff revisions: vs.
  @@ -118,10 +118,11 @@
118 118 if (!sgn) {
119 119 return false;
120 120 }
121 - /// Update current position
122 - WriteLock w_lock(_unitUpdateMutex);
123 - _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
124 - w_lock.unlock();
121 + {
122 + /// Update current position
123 + WriteLock w_lock(_unitUpdateMutex);
124 + _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
125 + }
125 126 return moveTo(vec3<F32>(targetPosition,
126 127 _currentPosition.y,
127 128 _currentPosition.z));
  @@ -133,10 +134,11 @@
133 134 if (!sgn) {
134 135 return false;
135 136 }
136 - /// Update current position
137 - WriteLock w_lock(_unitUpdateMutex);
138 - _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
139 - w_lock.unlock();
137 + {
138 + /// Update current position
139 + WriteLock w_lock(_unitUpdateMutex);
140 + _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
141 + }
140 142 return moveTo(vec3<F32>(_currentPosition.x,
141 143 targetPosition,
142 144 _currentPosition.z));
  @@ -148,10 +150,11 @@
148 150 if (!sgn) {
149 151 return false;
150 152 }
151 - /// Update current position
152 - WriteLock w_lock(_unitUpdateMutex);
153 - _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
154 - w_lock.unlock();
153 + {
154 + /// Update current position
155 + WriteLock w_lock(_unitUpdateMutex);
156 + _currentPosition = sgn->get<PhysicsComponent>()->getPosition();
157 + }
155 158 return moveTo(vec3<F32>(_currentPosition.x,
156 159 _currentPosition.y,
157 160 targetPosition));