aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-03 22:32:39 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2005-11-03 22:32:39 +0000
commit4f279505a85f4b697400f095fb18d5185685930d (patch)
tree691744da4e3fbdfaa9254a970bf880132d0d385a
parentc4c5858eb3ae32e3b21d53003bfd437c93cbf6a1 (diff)
downloadioquake3-aero-4f279505a85f4b697400f095fb18d5185685930d.tar.gz
ioquake3-aero-4f279505a85f4b697400f095fb18d5185685930d.zip
found the bug. alignment reenabled.
git-svn-id: svn://svn.icculus.org/quake3/trunk@252 edf5b092-35ff-0310-97b2-ce42778d08ea
-rw-r--r--code/botlib/be_ai_chat.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/code/botlib/be_ai_chat.c b/code/botlib/be_ai_chat.c
index ab4bf5f..85050e9 100644
--- a/code/botlib/be_ai_chat.c
+++ b/code/botlib/be_ai_chat.c
@@ -20,13 +20,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
-#if 0
+#if 1
#define ALIGN(x) \
do { \
- size_t oldx = x; \
x = (x+sizeof(void*)-1) & ~(sizeof(void*)-1L); \
- if(x != oldx) \
- botimport.Print(PRT_MESSAGE, "size %zd -> %zd\n", oldx, x); \
} while(0)
#else
#define ALIGN(x)
@@ -2128,14 +2125,16 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
//read the chat messages
while(!PC_CheckTokenString(source, "}"))
{
+ size_t len;
if (!BotLoadChatMessage(source, chatmessagestring))
{
FreeSource(source);
return NULL;
} //end if
+ len = strlen(chatmessagestring) + 1;
+ ALIGN(len);
if (pass)
{
- size_t len;
chatmessage = (bot_chatmessage_t *) ptr;
chatmessage->time = -2*CHATMESSAGE_RECENTTIME;
//put the chat message in the list
@@ -2145,13 +2144,11 @@ bot_chat_t *BotLoadInitialChat(char *chatfile, char *chatname)
ptr += sizeof(bot_chatmessage_t);
chatmessage->chatmessage = ptr;
strcpy(chatmessage->chatmessage, chatmessagestring);
- len = strlen(chatmessagestring) + 1;
- ALIGN(len);
ptr += len;
//the number of chat messages increased
chattype->numchatmessages++;
} //end if
- size += sizeof(bot_chatmessage_t) + strlen(chatmessagestring) + 1;
+ size += sizeof(bot_chatmessage_t) + len;
} //end if
} //end while
} //end if