修订版 | bed13a5d349800a8049e2aa25c3e0e2be9d60a3c (tree) |
---|---|
时间 | 2007-07-16 03:27:22 |
作者 | Benjamin Berkels <torr.samaho@quan...> |
Commiter | Benjamin Berkels |
Fixed: ACS function GiveInventory doesn't tell the correct inventory amount to a client.
SVN r385 (trunk)
@@ -71,6 +71,7 @@ | ||
71 | 71 | - - Fixed: User info is in some cases not updated to the server properly on connect, if it was changed when not connected to a server. [Torr Samaho] |
72 | 72 | - - Fixed: A few strings in error messages were referring to ZDoom instead of Skulltag. [Torr Samaho] |
73 | 73 | - - Fixed: ST crashes if a bot is spawned outside a map. Although bots should not be spawned there, ST should not crash in case such a thing happens. [Torr Samaho] |
74 | +- - Fixed: ACS function GiveInventory doesn't tell the correct inventory amount to a client. [Torr Samaho] | |
74 | 75 | - - IDESE: Changed server gametype setup: "+gametype 1" in .rsp file. This fixes that some dmflags were not respected in some gametypes. [Bond] |
75 | 76 | - - IDESE: Fixed a problem with bot names (prevented to add bot>6). [Bond] |
76 | 77 | ! - Changed the "enemy" to an "ally" icon that displays over your allies in team games. [Carnevil] |
@@ -241,6 +241,18 @@ | ||
241 | 241 | actor->player->PendingWeapon = savedPendingWeap; |
242 | 242 | } |
243 | 243 | |
244 | + // [BB] Since SERVERCOMMANDS_GiveInventory overwrites the item amount | |
245 | + // of the client with item->Amount, we have have to set this to the | |
246 | + // correct amount the player has. | |
247 | + AInventory *pInventory = NULL; | |
248 | + if( actor->player ) | |
249 | + { | |
250 | + if ( actor->player->mo ) | |
251 | + pInventory = actor->player->mo->FindInventory( info ); | |
252 | + } | |
253 | + if ( pInventory != NULL && item != NULL ) | |
254 | + item->Amount = pInventory->Amount; | |
255 | + | |
244 | 256 | // [BC] If we're the server, give the item to clients. |
245 | 257 | if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( actor->player ) && ( item )) |
246 | 258 | SERVERCOMMANDS_GiveInventory( actor->player - players, item ); |