aboutsummaryrefslogtreecommitdiff
path: root/games/cube
diff options
context:
space:
mode:
authorTilman Keskinoz <arved@FreeBSD.org>2007-08-03 14:01:44 +0000
committerTilman Keskinoz <arved@FreeBSD.org>2007-08-03 14:01:44 +0000
commite18160e80fe843c513ce2f36d7069e07e7e6bacc (patch)
tree9d853ca5706a56bd8e252bf4ee32165d810b9017 /games/cube
parente78c69cddfbb7e5e5d5acec45a4ceb095c8c7975 (diff)
downloadports-e18160e80fe843c513ce2f36d7069e07e7e6bacc.tar.gz
ports-e18160e80fe843c513ce2f36d7069e07e7e6bacc.zip
Notes
Diffstat (limited to 'games/cube')
-rw-r--r--games/cube/files/patch-clientextras.cpp16
-rw-r--r--games/cube/files/patch-server.cpp24
2 files changed, 36 insertions, 4 deletions
diff --git a/games/cube/files/patch-clientextras.cpp b/games/cube/files/patch-clientextras.cpp
new file mode 100644
index 000000000000..592ec6df6c87
--- /dev/null
+++ b/games/cube/files/patch-clientextras.cpp
@@ -0,0 +1,16 @@
+--- clientextras.cpp.orig 2007-08-03 15:45:28.000000000 +0200
++++ clientextras.cpp 2007-08-03 15:46:07.000000000 +0200
+@@ -14,11 +14,11 @@
+ int n = 3;
+ float speed = 100.0f;
+ float mz = d->o.z-d->eyeheight+1.55f*scale;
+- int basetime = -((int)d&0xFFF);
++ intptr_t basetime = -((intptr_t)d&0xFFF);
+ if(d->state==CS_DEAD)
+ {
+ int r;
+- if(hellpig) { n = 2; r = range[3]; } else { n = (int)d%3; r = range[n]; };
++ if(hellpig) { n = 2; r = range[3]; } else { n = (intptr_t)d%3; r = range[n]; };
+ basetime = d->lastaction;
+ int t = lastmillis-d->lastaction;
+ if(t<0 || t>20000) return;
diff --git a/games/cube/files/patch-server.cpp b/games/cube/files/patch-server.cpp
index 316b8130d2da..777abd25b693 100644
--- a/games/cube/files/patch-server.cpp
+++ b/games/cube/files/patch-server.cpp
@@ -1,5 +1,5 @@
---- server.cpp.orig Tue Feb 6 01:26:35 2007
-+++ server.cpp Tue Feb 6 01:27:06 2007
+--- server.cpp.orig 2007-08-03 15:52:35.000000000 +0200
++++ server.cpp 2007-08-03 15:58:58.000000000 +0200
@@ -104,7 +104,7 @@
void disconnect_client(int n, char *reason)
{
@@ -9,8 +9,24 @@
clients[n].type = ST_EMPTY;
send2(true, -1, SV_CDIS, n);
};
-@@ -408,6 +408,9 @@
- send2(true, -1, SV_CDIS, (int)event.peer->data);
+@@ -397,17 +397,20 @@
+ }
+ case ENET_EVENT_TYPE_RECEIVE:
+ brec += event.packet->dataLength;
+- process(event.packet, (int)event.peer->data);
++ process(event.packet, (intptr_t)event.peer->data);
+ if(event.packet->referenceCount==0) enet_packet_destroy(event.packet);
+ break;
+
+ case ENET_EVENT_TYPE_DISCONNECT:
+- if((int)event.peer->data<0) break;
+- printf("disconnected client (%s)\n", clients[(int)event.peer->data].hostname);
+- clients[(int)event.peer->data].type = ST_EMPTY;
+- send2(true, -1, SV_CDIS, (int)event.peer->data);
++ if((intptr_t)event.peer->data<0) break;
++ printf("disconnected client (%s)\n", clients[(intptr_t)event.peer->data].hostname);
++ clients[(intptr_t)event.peer->data].type = ST_EMPTY;
++ send2(true, -1, SV_CDIS, (intptr_t)event.peer->data);
event.peer->data = (void *)-1;
break;
+