1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-29 22:06:45 +00:00

Initialize fields to avoid undefined behaviour

This commit is contained in:
Andrei Kortunov 2020-06-18 14:50:06 +04:00
parent cf3a20b595
commit 808c905e1f
4 changed files with 5 additions and 1 deletions

View file

@ -36,6 +36,7 @@ namespace MWInput
, mSneakToggleShortcutTimer(0.f) , mSneakToggleShortcutTimer(0.f)
, mGamepadZoom(0) , mGamepadZoom(0)
, mGamepadGuiCursorEnabled(true) , mGamepadGuiCursorEnabled(true)
, mGuiCursorEnabled(true)
, mJoystickLastUsed(false) , mJoystickLastUsed(false)
, mSneakGamepadShortcut(false) , mSneakGamepadShortcut(false)
, mGamepadPreviewMode(false) , mGamepadPreviewMode(false)

View file

@ -80,7 +80,7 @@ namespace MWRender
class RefnumMarker : public osg::Object class RefnumMarker : public osg::Object
{ {
public: public:
RefnumMarker() : mNumVertices(0) {} RefnumMarker() : mNumVertices(0) { mRefnum.unset(); }
RefnumMarker(const RefnumMarker &copy, osg::CopyOp co) : mRefnum(copy.mRefnum), mNumVertices(copy.mNumVertices) {} RefnumMarker(const RefnumMarker &copy, osg::CopyOp co) : mRefnum(copy.mRefnum), mNumVertices(copy.mNumVertices) {}
META_Object(MWRender, RefnumMarker) META_Object(MWRender, RefnumMarker)

View file

@ -24,6 +24,7 @@ namespace
{ {
ESM::GlobalScript script; ESM::GlobalScript script;
script.mTargetRef.unset(); script.mTargetRef.unset();
script.mRunning = false;
if (!ptr.isEmpty()) if (!ptr.isEmpty())
{ {
if (ptr.getCellRef().hasContentFile()) if (ptr.getCellRef().hasContentFile())
@ -42,6 +43,7 @@ namespace
ESM::GlobalScript script; ESM::GlobalScript script;
script.mTargetId = pair.second; script.mTargetId = pair.second;
script.mTargetRef = pair.first; script.mTargetRef = pair.first;
script.mRunning = false;
return script; return script;
} }
}; };

View file

@ -28,6 +28,7 @@ ChunkManager::ChunkManager(Storage *storage, Resource::SceneManager *sceneMgr, T
, mSceneManager(sceneMgr) , mSceneManager(sceneMgr)
, mTextureManager(textureManager) , mTextureManager(textureManager)
, mCompositeMapRenderer(renderer) , mCompositeMapRenderer(renderer)
, mNodeMask(0)
, mCompositeMapSize(512) , mCompositeMapSize(512)
, mCompositeMapLevel(1.f) , mCompositeMapLevel(1.f)
, mMaxCompGeometrySize(1.f) , mMaxCompGeometrySize(1.f)