From 72ef7f6557893da699aad4eff9e1d64213c5ee17 Mon Sep 17 00:00:00 2001 From: Zaela Date: Tue, 25 Jun 2013 11:05:03 -0700 Subject: [PATCH] Made default-on-error a little less bad. --- zone/client_process.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 290413565..2c3af1a9f 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -2068,18 +2068,19 @@ void Client::HandleRespawnFromHover(uint32 Option) } //If they somehow chose an option they don't have, just send them to bind - RespawnOption default_to_bind; //must keep in scope! + RespawnOption* default_to_bind = nullptr; if (!chosen) { /* put error logging here */ BindStruct* b = &m_pp.binds[0]; - default_to_bind.name = "Bind Location"; - default_to_bind.zoneid = b->zoneId; - default_to_bind.x = b->x; - default_to_bind.y = b->y; - default_to_bind.z = b->z; - default_to_bind.heading = b->heading; - chosen = &default_to_bind; + default_to_bind = new RespawnOption; + default_to_bind->name = "Bind Location"; + default_to_bind->zoneid = b->zoneId; + default_to_bind->x = b->x; + default_to_bind->y = b->y; + default_to_bind->z = b->z; + default_to_bind->heading = b->heading; + chosen = default_to_bind; is_rez = false; } @@ -2192,6 +2193,8 @@ void Client::HandleRespawnFromHover(uint32 Option) MovePC(chosen->zoneid,chosen->x,chosen->y,chosen->z,chosen->heading,1); } + + safe_delete(default_to_bind); } void Client::ClearHover()