边缘世界 RimWorld

边缘世界 RimWorld

RimTalk
elaymana 8 月 28 日 上午 3:06
Found a bug related with emp launcher
[Description]

When firing an EMP weapon (e.g. EMP launcher) during combat, the game occasionally throws an exception on projectile tick. This happens specifically when the EMP projectile triggers a stun or interacts with a shield (CompProjectileInterceptor). The crash points to RimTalk’s Harmony Postfix on BattleLog.Add.

Disabling RimTalk immediately stops the error from occurring, so this appears to be caused by RimTalk’s log handling.

[Steps to Reproduce]

Enable RimTalk with RimWorld 1.6.4565 and Harmony + HugsLib.

Equip a colonist with an EMP launcher.

Fire at a target with a shield (or any pawn where EMP causes stun).

As soon as the projectile lands and the battle log tries to update, the error appears in the console.

[Expected Behavior]

EMP projectiles should generate normal stun/shield log entries without errors.

[Actual Behavior]

The following error is thrown every tick when the EMP projectile lands and logs the event:

Exception ticking Bullet_EMPLauncherXXXX: System.IndexOutOfRangeException: Index was outside the bounds of the array.
at RimTalk.Patch.BattleLog_Add.Postfix (Verse.LogEntry entry)
at Verse.BattleLog.Add (Verse.LogEntry entry)
at RimWorld.StunHandler.StunFor (...)
at RimWorld.CompProjectileInterceptor.BreakShieldEmp (...)
at Verse.Projectile.CheckForFreeInterceptBetween (...)
at Verse.Projectile.TickInterval (...)
at Verse.Thing.DoTick ()
at Verse.TickList.Tick ()


Disabling RimTalk removes the error entirely.

[Environment]

RimWorld version: 1.6.4565 rev734

Harmony: 2.x

HugsLib: 12.0.0

RimTalk: latest from Workshop (as of [insert date])

Other mods: Character Editor, Map Preview, etc. (but disabling RimTalk alone fixes the issue)

[Notes]

It seems RimTalk’s BattleLog_Add.Postfix assumes certain log entry arrays or fields are always valid, but EMP stun/shield log entries may differ. Adding a null/length check before accessing arrays in this Postfix should prevent the crash.
< >
正在显示第 1 - 2 条,共 2 条留言
Juicy  [开发者] 8 月 28 日 上午 5:19 
Thanks for the detailed report! I’ll be away for a few days, but I’ll get a fix out next week.
Juicy  [开发者] 9 月 3 日 下午 3:47 
This should now be resolved. Please let me know if you still encounter it.
< >
正在显示第 1 - 2 条,共 2 条留言
每页显示数: 1530 50