From 25d2c93ff9c89709c26a38e84e7b04f6ffa87eb7 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 15 Feb 2021 14:53:37 +0100 Subject: [PATCH 2/2] Transport (un)load: (un)set Sentry via SSCS. Use the packet PACKET_UNIT_SSCS_SET to set and unset Sentry on loading and unloading units from a transport. See osdn #41582 --- client/control.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/client/control.c b/client/control.c index c2a4b77e67..3d1154c1d4 100644 --- a/client/control.c +++ b/client/control.c @@ -1490,7 +1490,8 @@ struct unit *request_unit_unload_all(struct unit *punit) request_unit_unload(pcargo); if (pcargo->activity == ACTIVITY_SENTRY) { - request_new_unit_activity(pcargo, ACTIVITY_IDLE); + dsend_packet_unit_sscs_set(&client.conn, pcargo->id, + USSDT_SENTRY, 0); } if (unit_owner(pcargo) == unit_owner(punit)) { @@ -2064,8 +2065,8 @@ void request_unit_load(struct unit *pcargo, struct unit *ptrans, /* Sentry the unit. */ /* FIXME: Should not sentry if above loading fails (transport moved away, * or filled already in server side) */ - request_new_unit_activity_targeted(game_unit_by_number(pcargo->id), - ACTIVITY_SENTRY, NULL); + dsend_packet_unit_sscs_set(&client.conn, pcargo->id, + USSDT_SENTRY, 1); } } @@ -2092,8 +2093,8 @@ void request_unit_unload(struct unit *pcargo) if (unit_owner(pcargo) == client.conn.playing && pcargo->activity == ACTIVITY_SENTRY) { /* Activate the unit. */ - request_new_unit_activity_targeted(game_unit_by_number(pcargo->id), - ACTIVITY_IDLE, NULL); + dsend_packet_unit_sscs_set(&client.conn, pcargo->id, + USSDT_SENTRY, 0); } } } -- 2.20.1