mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
fix(BulletTool): 修复子弹伤害判定中未检查发射者的问题
在canDamage函数中添加对bullet.launcher的检查,避免当发射者为空时可能导致的错误
This commit is contained in:
@@ -6,7 +6,7 @@ static func fromArea(area: Area2D) -> BulletBase:
|
||||
else:
|
||||
return null
|
||||
static func canDamage(bullet: BulletBase, target: EntityBase) -> bool:
|
||||
if !bullet or !target: return false
|
||||
if !bullet or !target or !bullet.launcher: return false
|
||||
if target.currentInvinsible: return false
|
||||
if !bullet.canDamageSelf && target == bullet.launcher: return false
|
||||
if !GameRule.allowFriendlyFire:
|
||||
|
||||
Reference in New Issue
Block a user