ULTIMA8: Remove unneeded initializations identified by xcode

This commit is contained in:
Matthew Duggan 2020-03-28 13:52:26 +09:00
parent cacc668cec
commit d90db0e467
5 changed files with 5 additions and 9 deletions

View File

@ -505,7 +505,6 @@ void ContainerGump::DropItem(Item *item, int mx, int my) {
// combined, so delete item
item->destroy();
item = nullptr;
return;
}
}

View File

@ -111,12 +111,9 @@ void ItemRelativeGump::GumpToParent(int32 &gx, int32 &gy, PointRoundDir r) {
}
void ItemRelativeGump::GetItemLocation(int32 lerp_factor) {
Item *it = nullptr;
Item *next = nullptr;
Item *prev = nullptr;
Gump *gump = nullptr;
it = getItem(_owner);
Item *it = getItem(_owner);
if (!it) {
// This shouldn't ever happen, the GumpNotifyProcess should
@ -125,6 +122,8 @@ void ItemRelativeGump::GetItemLocation(int32 lerp_factor) {
return;
}
Item *next;
Item *prev;
while ((next = it->getParentAsContainer()) != nullptr) {
prev = it;
it = next;

View File

@ -61,7 +61,7 @@ MainActor::~MainActor() {
}
GravityProcess *MainActor::ensureGravityProcess() {
AvatarGravityProcess *p = nullptr;
AvatarGravityProcess *p;
if (_gravityPid) {
p = p_dynamic_cast<AvatarGravityProcess *>(
Kernel::get_instance()->getProcess(_gravityPid));

View File

@ -1452,7 +1452,7 @@ int32 Item::ascend(int delta) {
}
GravityProcess *Item::ensureGravityProcess() {
GravityProcess *p = nullptr;
GravityProcess *p;
if (_gravityPid) {
p = p_dynamic_cast<GravityProcess *>(
Kernel::get_instance()->getProcess(_gravityPid));

View File

@ -75,7 +75,6 @@ void SplitItemProcess::run() {
targetitem->callUsecodeEvent_combine();
} else {
targetitem->destroy();
targetitem = nullptr;
}
if (origcount > 0) {
@ -83,7 +82,6 @@ void SplitItemProcess::run() {
original->callUsecodeEvent_combine();
} else {
original->destroy(); // note: this terminates us
original = nullptr;
}
_result = 0;