--- PCKi.cpp.orig	Sun Jan 16 15:49:49 2011 +0100
+++ PCKi.cpp	Tue Jan 18 03:13:39 2011 -0600
@@ -34,6 +34,8 @@
 
 PC_SINGLETON_IMPL_WITH_CTOR_DTOR(PCKi)
 
+extern FILE *chatlog;
+
 void PCKi::drawPlayerList()
 {
   plFont* font = PCFontMgr::instance().findFont("Courier", 10);
@@ -125,6 +127,9 @@
 {
   plString buf_string = msg->getUser() + ": " + msg->getString();
   msgs.push_back(buf_string);
+  buf_string += "\n";
+  fputs(buf_string.cstr(), chatlog);
+  fflush(chatlog);
   if(msgs.size() > 10)
     msgs.pop_front();
 }
--- main.cpp.orig	Fri Feb 04 20:24:50 2011 -0800
+++ main.cpp	Fri Feb 04 23:42:13 2011 -0600
@@ -56,6 +56,8 @@
 extern double zoom;
 extern bool zooming;
 
+FILE *chatlog;
+
 double prev_sba = 1.0;
 bool drawfps = true;
 int strafeKeysDown = 0;
@@ -122,6 +124,8 @@
   fps.font = arial;
   fps.X = pcClient::instance().getSettings().width - 3*arial->getWidth();
   fps.Y = 5;
+  
+  chatlog = fopen("/tmp/pcchat.log", "a");
 
 //  FontLine loc;
 //  loc.font = arial;
@@ -632,6 +636,8 @@
 
   pcClient::instance().writeAWPC();
 
+  fclose(chatlog);
+
   // Free all the global stuff so tools like valgrind won't complain
   // TODO this is probably wrong on some level
   pcAuthClient::instance().disconnect();