Correct UB in Event constructors; use member initializer lists
This commit is contained in:
parent
40a7e23b34
commit
8e2388cf62
1 changed files with 16 additions and 20 deletions
|
@ -12,29 +12,25 @@ QString EventType::HiddenItem = "event_hidden_item";
|
||||||
QString EventType::SecretBase = "event_secret_base";
|
QString EventType::SecretBase = "event_secret_base";
|
||||||
QString EventType::HealLocation = "event_heal_location";
|
QString EventType::HealLocation = "event_heal_location";
|
||||||
|
|
||||||
Event::Event()
|
Event::Event() :
|
||||||
{
|
spriteWidth(16),
|
||||||
this->spriteWidth = 16;
|
spriteHeight(16),
|
||||||
this->spriteHeight = 16;
|
usingSprite(false)
|
||||||
this->usingSprite = false;
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
Event::Event(const Event& toCopy)
|
Event::Event(const Event& toCopy) :
|
||||||
{
|
values(toCopy.values),
|
||||||
Event();
|
customValues(toCopy.customValues),
|
||||||
this->values = toCopy.values;
|
pixmap(toCopy.pixmap),
|
||||||
this->customValues = toCopy.customValues;
|
spriteWidth(toCopy.spriteWidth),
|
||||||
this->pixmap = toCopy.pixmap;
|
spriteHeight(toCopy.spriteHeight),
|
||||||
this->spriteWidth = toCopy.spriteWidth;
|
frame(toCopy.frame),
|
||||||
this->spriteHeight = toCopy.spriteHeight;
|
hFlip(toCopy.hFlip),
|
||||||
this->frame = toCopy.frame;
|
usingSprite(toCopy.usingSprite)
|
||||||
this->hFlip = toCopy.hFlip;
|
{ }
|
||||||
this->usingSprite = toCopy.usingSprite;
|
|
||||||
}
|
|
||||||
|
|
||||||
Event::Event(QJsonObject obj, QString type)
|
Event::Event(QJsonObject obj, QString type) : Event()
|
||||||
{
|
{
|
||||||
Event();
|
|
||||||
this->put("event_type", type);
|
this->put("event_type", type);
|
||||||
this->readCustomValues(obj);
|
this->readCustomValues(obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue