Non-trivial copiable object fixes, limited to the engine's itself

not the third parties parts.
This commit is contained in:
David Carlier
2018-07-29 19:31:47 +01:00
parent c143d43fc6
commit 06d2ef6101
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ void Blueprint::create(Object* obj, const Design* design) {
data[i] = new CScriptAny(devices.scripts.server->engine); data[i] = new CScriptAny(devices.scripts.server->engine);
memset(effectorStates, 0, design->effectorStateCount * sizeof(double)); memset(effectorStates, 0, design->effectorStateCount * sizeof(double));
memset(effectorTargets, 0, design->effectorCount * sizeof(EffectorTarget)); memset(reinterpret_cast<void *>(effectorTargets), 0, design->effectorCount * sizeof(EffectorTarget));
for(unsigned i = 0; i < cnt; ++i) { for(unsigned i = 0; i < cnt; ++i) {
auto& sys = design->subsystems[i]; auto& sys = design->subsystems[i];
+1 -1
View File
@@ -913,7 +913,7 @@ public:
type.grab(); type.grab();
states = new double[type.type.stateCount](); states = new double[type.type.stateCount]();
memset(&target, 0, sizeof(EffectorTarget)); memset(reinterpret_cast<void *>(&target), 0, sizeof(EffectorTarget));
target.tracking = vec3d::front(); target.tracking = vec3d::front();
} }
+2 -2
View File
@@ -25,7 +25,7 @@ struct frustum {
} }
void operator=(const frustum& other) { void operator=(const frustum& other) {
memcpy(this, &other, sizeof(frustum)); memcpy(reinterpret_cast<void *>(this), &other, sizeof(frustum));
} }
bool overlaps(const vec3d& center, double radius) const { bool overlaps(const vec3d& center, double radius) const {
@@ -34,4 +34,4 @@ struct frustum {
return false; return false;
return true; return true;
} }
}; };