Fix passing hedgehogs number from engine to frontend
authorunc0rr
Sat, 14 Feb 2009 16:25:58 +0000
changeset 1791 7c9d645d2591
parent 1790 c84223511ca8
child 1792 c30c6944bd49
Fix passing hedgehogs number from engine to frontend
QTfrontend/hwmap.cpp
hedgewars/hwengine.dpr
--- a/QTfrontend/hwmap.cpp	Sat Feb 14 16:24:20 2009 +0000
+++ b/QTfrontend/hwmap.cpp	Sat Feb 14 16:25:58 2009 +0000
@@ -49,7 +49,7 @@
 		quint8 *buf = (quint8*) readbuffer.constData();
 		QImage im(buf, 256, 128, QImage::Format_Mono);
 		im.setNumColors(2);
-		emit HHLimitReceived(buf[128 * 32 + 1]);
+		emit HHLimitReceived(buf[128 * 32]);
 		emit ImageReceived(im);
 	}
 }
--- a/hedgewars/hwengine.dpr	Sat Feb 14 16:24:20 2009 +0000
+++ b/hedgewars/hwengine.dpr	Sat Feb 14 16:25:58 2009 +0000
@@ -270,6 +270,7 @@
 /////////////////////////
 procedure GenLandPreview;
 var Preview: TPreview;
+	h: byte;
 begin
 InitIPC;
 IPCWaitPongEvent;
@@ -280,6 +281,8 @@
 Preview:= GenPreview;
 WriteLnToConsole('Sending preview...');
 SendIPCRaw(@Preview, sizeof(Preview));
+h:= MaxHedgehogs;
+SendIPCRaw(@h, sizeof(h));
 WriteLnToConsole('Preview sent, disconnect');
 CloseIPC
 end;