Skip to content

Commit

Permalink
That fix was too strong to prevent picking up non-permanent objects w…
Browse files Browse the repository at this point in the history
…hich have pick-up transitions

e.g. sealed bottles
  • Loading branch information
risvh committed Oct 22, 2023
1 parent 285440d commit b309633
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19679,21 +19679,19 @@ int main() {
if( target > 0 ) {
ObjectRecord *targetObj =
getObject( target );

// consider bare-hand action
TransRecord *handTrans = getPTrans(
0, target );

if( ! targetObj->permanent &&
handTrans == NULL &&
targetObj->minPickupAge <=
computeAge( nextPlayer ) ) {

// treat it like pick up
pickupToHold( nextPlayer, m.x, m.y,
target );
}
else {
else if( targetObj->permanent ) {
// consider bare-hand action
TransRecord *handTrans = getPTrans(
0, target );

if( handTrans == NULL ) {
// check for instant decay
Expand All @@ -19714,14 +19712,16 @@ int main() {
}
}

// try treating it like
// a USE action
m.type = USE;
m.id = -1;
m.c = -1;
playerIndicesToSendUpdatesAbout.
deleteElementEqualTo( i );
goto RESTART_MESSAGE_ACTION;
if( handTrans != NULL ) {
// try treating it like
// a USE action
m.type = USE;
m.id = -1;
m.c = -1;
playerIndicesToSendUpdatesAbout.
deleteElementEqualTo( i );
goto RESTART_MESSAGE_ACTION;
}
}
}
}
Expand Down

0 comments on commit b309633

Please sign in to comment.