Fixed letting go of dragged character when entering/exiting the sub, fixed spawnitems not being visible in the job info window
This commit is contained in:
@@ -87,11 +87,7 @@ namespace Barotrauma
|
||||
currTargetPos = target.SimPosition;
|
||||
|
||||
//if character is outside the sub and target isn't, transform the position
|
||||
if (character.Submarine == null && target.Submarine != null)
|
||||
{
|
||||
//currTargetPos += target.Submarine.SimPosition;
|
||||
}
|
||||
else if (target.Submarine == null)
|
||||
if (character.Submarine != null && target.Submarine == null)
|
||||
{
|
||||
currTargetPos -= character.Submarine.SimPosition;
|
||||
}
|
||||
|
||||
@@ -931,7 +931,7 @@ namespace Barotrauma
|
||||
LimbType type = i == 0 ? leftHandTarget: rightHandTarget;
|
||||
Limb targetLimb = target.AnimController.GetLimb(type);
|
||||
|
||||
Limb pullLimb = GetLimb(i == 0 ?LimbType.LeftHand: LimbType.RightHand);
|
||||
Limb pullLimb = GetLimb(i == 0 ? LimbType.LeftHand: LimbType.RightHand);
|
||||
|
||||
if (i==1 && inWater)
|
||||
{
|
||||
@@ -939,15 +939,16 @@ namespace Barotrauma
|
||||
}
|
||||
else
|
||||
{
|
||||
Vector2 diff = ConvertUnits.ToSimUnits(targetLimb.WorldPosition - pullLimb.WorldPosition);
|
||||
|
||||
pullLimb.pullJoint.Enabled = true;
|
||||
pullLimb.pullJoint.WorldAnchorB = targetLimb.SimPosition;
|
||||
pullLimb.pullJoint.WorldAnchorB = pullLimb.SimPosition + diff;
|
||||
pullLimb.pullJoint.MaxForce = 10000.0f;
|
||||
|
||||
targetLimb.pullJoint.Enabled = true;
|
||||
targetLimb.pullJoint.WorldAnchorB = pullLimb.SimPosition;
|
||||
targetLimb.pullJoint.WorldAnchorB = targetLimb.SimPosition - diff;
|
||||
targetLimb.pullJoint.MaxForce = 10000.0f;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -715,7 +715,7 @@ namespace Barotrauma
|
||||
|
||||
if (selectedCharacter!=null)
|
||||
{
|
||||
if (Vector2.Distance(selectedCharacter.SimPosition, SimPosition) > 3.0f || !selectedCharacter.CanBeSelected)
|
||||
if (Vector2.Distance(selectedCharacter.WorldPosition, WorldPosition) > 300.0f || !selectedCharacter.CanBeSelected)
|
||||
{
|
||||
DeselectCharacter(controlled == this);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ namespace Barotrauma
|
||||
|
||||
public readonly XElement Items;
|
||||
public readonly List<string> ItemNames;
|
||||
//public List<bool> EquipItem;
|
||||
|
||||
public List<SkillPrefab> Skills;
|
||||
|
||||
@@ -71,7 +70,6 @@ namespace Barotrauma
|
||||
AllowAlways = ToolBox.GetAttributeBool(element, "allowalways", false);
|
||||
|
||||
ItemNames = new List<string>();
|
||||
//EquipItem = new List<bool>();
|
||||
|
||||
Skills = new List<SkillPrefab>();
|
||||
|
||||
@@ -83,16 +81,9 @@ namespace Barotrauma
|
||||
Items = subElement;
|
||||
foreach (XElement itemElement in subElement.Elements())
|
||||
{
|
||||
string itemName = ToolBox.GetAttributeString(subElement, "name", "");
|
||||
ItemNames.Add(itemName);
|
||||
string itemName = ToolBox.GetAttributeString(itemElement, "name", "");
|
||||
if (!string.IsNullOrWhiteSpace(itemName)) ItemNames.Add(itemName);
|
||||
}
|
||||
//string itemName = ToolBox.GetAttributeString(subElement, "name", "");
|
||||
//bool equipItem = ToolBox.GetAttributeBool(subElement, "equip", false);
|
||||
//if (!string.IsNullOrEmpty(itemName))
|
||||
//{
|
||||
// ItemNames.Add(itemName);
|
||||
// EquipItem.Add(equipItem);
|
||||
//}
|
||||
break;
|
||||
case "skills":
|
||||
foreach (XElement skillElement in subElement.Elements())
|
||||
@@ -153,9 +144,6 @@ namespace Barotrauma
|
||||
y += 20;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return backFrame;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user