Browse Source

1、演练结束退回到角色选择时水火对抗相关脚本报错,原因为房间已经销毁,判断房间的条件空引用

2、设置全液面火并设置全液面火,放置集结区时报空,原因为设置全页面火时没有同步全液面火的罐id,导致找不到罐
develop
曹衍涛 5 years ago
parent
commit
aa18e341cf
  1. 1
      Assets/Scripts/Common/Disasters/FireLiquidLevelCtrl.cs
  2. 2
      Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightLeak1.cs
  3. 10
      Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs
  4. 8
      Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/WaterFightFire.cs

1
Assets/Scripts/Common/Disasters/FireLiquidLevelCtrl.cs

@ -114,6 +114,7 @@ public class FireLiquidLevelCtrl : MonoBehaviour
arg.gameObjID = GetComponent<CloneGameObjInfo>().gameObjID;
arg.SendUserID = CurrentUserInfo.mySelf.Id;
arg.firescale = FireScale;
arg.oilTankID = TargetNormalID;
NetworkManager.Default.SendAsync("SET_FIRE_LIQUID_SYNC", arg);
}
}

2
Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightLeak1.cs

@ -41,7 +41,7 @@ public class FireFightLeak1 : MonoBehaviour
void OnParticleCollision(GameObject other)
{
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room!=null&& CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
if (GetComponent<BaseGameObjInfo>().gameObjType == CloneObjType.Leak1)
{

10
Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/FireFightNormal.cs

@ -89,10 +89,14 @@ public class FireFightNormal : MonoBehaviour
GetComponent<SpreadedFireCtrl>())
{
long mainFireId = GetComponent<SpreadedFireCtrl>().fireGameObjID;
if (SpreadFireController.fireStruckContainDic[mainFireId].Contains(this))
if (SpreadFireController.fireStruckContainDic.ContainsKey(mainFireId))
{
SpreadFireController.fireStruckContainDic[mainFireId].Remove(this);
if (SpreadFireController.fireStruckContainDic[mainFireId].Contains(this))
{
SpreadFireController.fireStruckContainDic[mainFireId].Remove(this);
}
}
}
Straightwater.Clear();
FrothList.Clear();
@ -116,7 +120,7 @@ public class FireFightNormal : MonoBehaviour
void OnParticleCollision(GameObject other)
{
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
if (baseinfo.gameObjType == CloneObjType.fireNormal)
{

8
Assets/Scripts/DongYouLiQing/BaseCommander/WaterFightFire/WaterFightFire.cs

@ -128,7 +128,7 @@ public class WaterFightFire : MonoBehaviour
private void OnDontinCollider(List<ParticleSystem.Particle> inside)
{
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
//水枪移出火堆
timer -= Time.deltaTime;
@ -180,7 +180,7 @@ public class WaterFightFire : MonoBehaviour
void OnInSideCollider(List<ParticleSystem.Particle> insides)
{
if (CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
if (CurrentUserInfo.room!=null&&CurrentUserInfo.mySelf.Id == CurrentUserInfo.room.Owner.UserInfo.Id)
{
timer -= Time.deltaTime;
if (timer < 0)
@ -359,7 +359,7 @@ public class WaterFightFire : MonoBehaviour
public void OnDisable()
{
if (Target != null)
if (Target != null&&Target.GetComponent<FireFightNormal>())
{
if (Target.GetComponent<FireFightNormal>().Straightwater.Contains(this))
Target.GetComponent<FireFightNormal>().Straightwater.Remove(this);
@ -371,7 +371,7 @@ public class WaterFightFire : MonoBehaviour
public void OnDestroy()
{
if (Target != null)
if (Target != null && Target.GetComponent<FireFightNormal>())
{
if (Target.GetComponent<FireFightNormal>().Straightwater.Contains(this))
Target.GetComponent<FireFightNormal>().Straightwater.Remove(this);

Loading…
Cancel
Save