mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-09-24 09:12:51 -04:00
mostly template initializations to prevent undefined behavior in the
(unlikely) chance some of these properties are used
This commit is contained in:
+11
-13
@@ -24,20 +24,20 @@
|
||||
|
||||
const std::string DefaultString("");
|
||||
const StringId DefaultStringId("", 0);
|
||||
const Vector DefaultVector(0,0,0);
|
||||
const Vector DefaultVector(0, 0, 0);
|
||||
const TriggerVolumeData DefaultTriggerVolumeData;
|
||||
|
||||
bool ServerGroupObjectTemplate::ms_allowDefaultTemplateParams = true;
|
||||
|
||||
|
||||
/**
|
||||
* Class constructor.
|
||||
*/
|
||||
ServerGroupObjectTemplate::ServerGroupObjectTemplate(const std::string & filename)
|
||||
//@BEGIN TFD INIT
|
||||
: ServerUniverseObjectTemplate(filename)
|
||||
,m_versionOk(true)
|
||||
//@END TFD INIT
|
||||
, m_versionOk(true)
|
||||
, m_templateVersion(0)
|
||||
//@END TFD INIT
|
||||
{
|
||||
} // ServerGroupObjectTemplate::ServerGroupObjectTemplate
|
||||
|
||||
@@ -46,8 +46,8 @@ ServerGroupObjectTemplate::ServerGroupObjectTemplate(const std::string & filenam
|
||||
*/
|
||||
ServerGroupObjectTemplate::~ServerGroupObjectTemplate()
|
||||
{
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
//@BEGIN TFD CLEANUP
|
||||
//@END TFD CLEANUP
|
||||
} // ServerGroupObjectTemplate::~ServerGroupObjectTemplate
|
||||
|
||||
/**
|
||||
@@ -123,8 +123,8 @@ Object * ServerGroupObjectTemplate::createObject(void) const
|
||||
*/
|
||||
void ServerGroupObjectTemplate::load(Iff &file)
|
||||
{
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
static const int MAX_NAME_SIZE = 256;
|
||||
char paramName[MAX_NAME_SIZE];
|
||||
|
||||
if (file.getCurrentName() != ServerGroupObjectTemplate_tag)
|
||||
{
|
||||
@@ -134,7 +134,7 @@ char paramName[MAX_NAME_SIZE];
|
||||
|
||||
file.enterForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
if (m_templateVersion == TAG(D,E,R,V))
|
||||
if (m_templateVersion == TAG(D, E, R, V))
|
||||
{
|
||||
file.enterForm();
|
||||
file.enterChunk();
|
||||
@@ -154,10 +154,8 @@ char paramName[MAX_NAME_SIZE];
|
||||
file.exitForm();
|
||||
m_templateVersion = file.getCurrentName();
|
||||
}
|
||||
if (getHighestTemplateVersion() != TAG(0,0,0,0))
|
||||
if (getHighestTemplateVersion() != TAG(0, 0, 0, 0))
|
||||
{
|
||||
|
||||
|
||||
m_versionOk = false;
|
||||
}
|
||||
|
||||
@@ -175,4 +173,4 @@ char paramName[MAX_NAME_SIZE];
|
||||
return;
|
||||
} // ServerGroupObjectTemplate::load
|
||||
|
||||
//@END TFD
|
||||
//@END TFD
|
||||
Reference in New Issue
Block a user