forked from mirror/openmw-tes3mp
Fix globals not being initialized with a valid type.
parent
d7845012bf
commit
448c9d5a5b
@ -0,0 +1,26 @@
|
|||||||
|
#include "globalcreator.hpp"
|
||||||
|
|
||||||
|
#include <components/esm/variant.hpp>
|
||||||
|
|
||||||
|
#include "../../model/world/data.hpp"
|
||||||
|
#include "../../model/world/commands.hpp"
|
||||||
|
#include "../../model/world/columns.hpp"
|
||||||
|
#include "../../model/world/idtable.hpp"
|
||||||
|
|
||||||
|
namespace CSVWorld
|
||||||
|
{
|
||||||
|
void GlobalCreator::configureCreateCommand (CSMWorld::CreateCommand& command) const
|
||||||
|
{
|
||||||
|
CSMWorld::IdTable* table = static_cast<CSMWorld::IdTable*>(getData().getTableModel(getCollectionId()));
|
||||||
|
|
||||||
|
int index = table->findColumnIndex(CSMWorld::Columns::ColumnId_ValueType);
|
||||||
|
int type = (int)ESM::VT_Float;
|
||||||
|
|
||||||
|
command.addValue(index, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
GlobalCreator::GlobalCreator(CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id)
|
||||||
|
: GenericCreator (data, undoStack, id, true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef CSV_WORLD_GLOBALCREATOR_H
|
||||||
|
#define CSV_WORLD_GLOBALCREATOR_H
|
||||||
|
|
||||||
|
#include "genericcreator.hpp"
|
||||||
|
|
||||||
|
namespace CSVWorld
|
||||||
|
{
|
||||||
|
class GlobalCreator : public GenericCreator
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
GlobalCreator(CSMWorld::Data& data, QUndoStack& undoStack, const CSMWorld::UniversalId& id);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
virtual void configureCreateCommand(CSMWorld::CreateCommand& command) const;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue