(c35335f47) Fixed CharacterInfo.IncreaseSkillLevel crashing if the character has been removed, steering component stops giving xp to the user if the user is removed. Closes #1553
This commit is contained in:
@@ -747,7 +747,7 @@ namespace Barotrauma
|
|||||||
|
|
||||||
public void IncreaseSkillLevel(string skillIdentifier, float increase, Vector2 worldPos)
|
public void IncreaseSkillLevel(string skillIdentifier, float increase, Vector2 worldPos)
|
||||||
{
|
{
|
||||||
if (Job == null || (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient)) return;
|
if (Job == null || (GameMain.NetworkMember != null && GameMain.NetworkMember.IsClient) || Character == null) { return; }
|
||||||
|
|
||||||
float prevLevel = Job.GetSkillLevel(skillIdentifier);
|
float prevLevel = Job.GetSkillLevel(skillIdentifier);
|
||||||
Job.IncreaseSkillLevel(skillIdentifier, increase);
|
Job.IncreaseSkillLevel(skillIdentifier, increase);
|
||||||
|
|||||||
@@ -210,6 +210,11 @@ namespace Barotrauma.Items.Components
|
|||||||
|
|
||||||
if (voltage < minVoltage && currPowerConsumption > 0.0f) { return; }
|
if (voltage < minVoltage && currPowerConsumption > 0.0f) { return; }
|
||||||
|
|
||||||
|
if (user != null && user.Removed)
|
||||||
|
{
|
||||||
|
user = null;
|
||||||
|
}
|
||||||
|
|
||||||
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
ApplyStatusEffects(ActionType.OnActive, deltaTime, null);
|
||||||
|
|
||||||
if (autoPilot)
|
if (autoPilot)
|
||||||
|
|||||||
Reference in New Issue
Block a user