mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-20 23:01:36 -04:00
*Massive cleanup (\n\n -> \n, *\n -> \n, cleanup for(...) to for (...), and some other cleanups by hand)
*Fix a possible crash in Spell::DoAllEffectOnTarget --HG-- branch : trunk
This commit is contained in:
@@ -17,28 +17,21 @@
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "DatabaseEnv.h"
|
||||
|
||||
Field::Field() :
|
||||
mValue(NULL), mType(DB_TYPE_UNKNOWN)
|
||||
{
|
||||
}
|
||||
|
||||
Field::Field(Field &f)
|
||||
{
|
||||
const char *value;
|
||||
|
||||
value = f.GetString();
|
||||
|
||||
if (value && (mValue = new char[strlen(value) + 1]))
|
||||
strcpy(mValue, value);
|
||||
else
|
||||
mValue = NULL;
|
||||
|
||||
mType = f.GetType();
|
||||
}
|
||||
|
||||
Field::Field(const char *value, enum Field::DataTypes type) :
|
||||
mType(type)
|
||||
{
|
||||
@@ -47,16 +40,13 @@ mType(type)
|
||||
else
|
||||
mValue = NULL;
|
||||
}
|
||||
|
||||
Field::~Field()
|
||||
{
|
||||
if(mValue) delete [] mValue;
|
||||
}
|
||||
|
||||
void Field::SetValue(const char *value)
|
||||
{
|
||||
if(mValue) delete [] mValue;
|
||||
|
||||
if (value)
|
||||
{
|
||||
mValue = new char[strlen(value) + 1];
|
||||
|
||||
Reference in New Issue
Block a user