From 77478707f2aaabde16c1695de2db6b2159df8471 Mon Sep 17 00:00:00 2001 From: oy Date: Sun, 15 Dec 2013 12:30:27 +0100 Subject: [PATCH] fixed a server crash due to faulty offsets. #1173 --- src/engine/shared/console.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/engine/shared/console.h b/src/engine/shared/console.h index bbe267d42..a45a7fd6e 100644 --- a/src/engine/shared/console.h +++ b/src/engine/shared/console.h @@ -98,12 +98,11 @@ class CConsole : public IConsole if(this != &Other) { IResult::operator=(Other); - int Offset = m_aStringStorage - Other.m_aStringStorage; mem_copy(m_aStringStorage, Other.m_aStringStorage, sizeof(m_aStringStorage)); - m_pArgsStart = Other.m_pArgsStart + Offset; - m_pCommand = Other.m_pCommand + Offset; + m_pArgsStart = m_aStringStorage+(Other.m_pArgsStart-Other.m_aStringStorage); + m_pCommand = m_aStringStorage+(Other.m_pCommand-Other.m_aStringStorage); for(unsigned i = 0; i < Other.m_NumArgs; ++i) - m_apArgs[i] = Other.m_apArgs[i] + Offset; + m_apArgs[i] = m_aStringStorage+(Other.m_apArgs[i]-Other.m_aStringStorage); } return *this; }