Skip to content

Commit d00713e

Browse files
committed
Fixed crash when rocket ride is interrupted by rider disconnecting and then re-connecting as a twin. Fixes #1110
1 parent dfec633 commit d00713e

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

documentation/changeLog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ Server Fixes:
1010
--Fixed so that shutdownLongLineagePos.txt is cleared during apocalypse, so
1111
that Eve location is fully reset to 0. Fixes #1103
1212

13+
--Fixed crash when rocket ride is interrupted by rider disconnecting and then
14+
re-connecting as a twin. Fixes #1110
15+
1316

1417

1518

server/lifeLog.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ void logDeath( int inPlayerID, char *inPlayerEmail,
262262
if( inKillerID == inPlayerID ) {
263263
causeString = stringDuplicate( "suicide" );
264264
}
265+
else if( inKillerID == -999999998 ) {
266+
causeString =
267+
stringDuplicate( "rocket_ride_interrupted" );
268+
}
269+
else if( inKillerID == -999999999 ) {
270+
causeString =
271+
stringDuplicate( "rocket_ride_completed" );
272+
}
265273
else if( inKillerID < -1 ) {
266274

267275
// use cleaned-up non-human object string
@@ -284,6 +292,11 @@ void logDeath( int inPlayerID, char *inPlayerEmail,
284292
nextSpace = strstr( nextSpace, " " );
285293
}
286294
}
295+
else {
296+
causeString =
297+
autoSprintf( "killed_by_unknown_object_%d",
298+
-inKillerID );
299+
}
287300
}
288301
else {
289302
causeString = stringDuplicate( "hunger" );

server/server.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27143,6 +27143,10 @@ int main() {
2714327143
// include as negative of ID
2714427144
killerID = - nextPlayer->deathSourceID;
2714527145
}
27146+
else if( nextPlayer->rodeRocket ) {
27147+
// completed rocket ride
27148+
killerID = -999999999;
27149+
}
2714627150
// never have suicide in this case
2714727151

2714827152
logDeath( nextPlayer->id,
@@ -27394,7 +27398,8 @@ int main() {
2739427398
killerID = nextPlayer->id;
2739527399
}
2739627400
else if( nextPlayer->rodeRocket ) {
27397-
killerID = -999999999;
27401+
// rocket interrupted by error
27402+
killerID = -999999998;
2739827403
}
2739927404

2740027405
char male = ! getFemale( nextPlayer );

0 commit comments

Comments
 (0)