- Timestamp:
- Jul 24, 2014, 3:25:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
binary-improvements/7dtd-server-fixes/src/PlayerDataStuff.cs
r98 r103 13 13 foreach (InventoryField item in _belt) { 14 14 if (item.count > 0) { 15 string name = getInvFieldName (item);16 if (belt.ContainsKey (name)) {17 belt [name] += item.count;15 string name = getInvFieldName (item); 16 if (belt.ContainsKey (name)) { 17 belt [name] += item.count; 18 18 } else { 19 19 belt.Add (name, item.count); … … 24 24 foreach (InventoryField item in _bag) { 25 25 if (item.count > 0) { 26 string name = getInvFieldName (item);27 if (bag.ContainsKey (name)) {28 bag [name] += item.count;26 string name = getInvFieldName (item); 27 if (bag.ContainsKey (name)) { 28 bag [name] += item.count; 29 29 } else { 30 30 bag.Add (name, item.count); … … 47 47 public static void GM_SavePlayerData (GameManager manager, int _clientId, PlayerDataFile _playerDataFile) 48 48 { 49 if (manager.connectionManager.mapClientToEntity.ContainsKey (_clientId)) { 50 int entityId = manager.connectionManager.mapClientToEntity [_clientId]; 51 Log.Out ("Saving playerData for entity id: " + entityId); 49 try { 50 int entityId = CommonMappingFunctions.GetEntityID (CommonMappingFunctions.GetClientInfoFromClientID (_clientId)); 51 if (entityId >= 0) { 52 Log.Out ("Saving playerData for entity id: " + entityId); 52 53 53 if (itemsPerEntityId.ContainsKey(entityId)) 54 itemsPerEntityId.Remove(entityId); 55 itemsPerEntityId.Add (entityId, new PlayerItems (_playerDataFile.inventory, _playerDataFile.bag)); 54 if (itemsPerEntityId.ContainsKey (entityId)) 55 itemsPerEntityId.Remove (entityId); 56 itemsPerEntityId.Add (entityId, new PlayerItems (_playerDataFile.inventory, _playerDataFile.bag)); 57 } 58 } catch (Exception e) { 59 Log.Out ("Error in GM_SavePlayerData: " + e); 56 60 } 57 61 /*
Note:
See TracChangeset
for help on using the changeset viewer.