-
Notifications
You must be signed in to change notification settings - Fork 321
Fix all errors regarding auto mortars #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -643,6 +643,7 @@ private void InitGun() | |||
| CompAmmo.turret = this; | |||
| //if (def.building.turretShellDef != null && def.building.turretShellDef is AmmoDef) CompAmmo.selectedAmmo = (AmmoDef)def.building.turretShellDef; | |||
| } | |||
| gunInt = GetOrCreateGunInt(); | |||
| List<Verb> allVerbs = this.gunInt.TryGetComp<CompEquippable>().AllVerbs; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you replace this.gunInt with Gun and let the property handle instancing gunInt? That way you won't need GetOrCreateGunInt() anymore, which seems a bit redundant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is that Gun has a bunch of other side effects that I'm not familiar with.
- Add CompAmmo to the auto mortar turret. - Move UseAmmo check to JobGiverUtils_Reload and refactor HasJobOnThing - Fix null errors
- Uses new GetOrCreateGunInt() - Small cleaning up
e72f439 to
8919d19
Compare
LockdownX7
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While this does fix the previous errors with mech mortars, there's a new error when a cluster containing a mortar wakes up. All mechanoids in the cluster throw this every few seconds:
CE - MakeReloadJob() (1331) - Mech_Scyther43532 tried to create a reload job without ammo. This should have been checked earlier.
Verse.Log:Error(String, Boolean)
CombatExtended.CombatExtended.LoggerUtils.CELogger:Error(String, Boolean, String)
CombatExtended.CombatExtended.Jobs.Utils.JobGiverUtils_Reload:MakeReloadJob(Pawn, Building_TurretGunCE)
CombatExtended.JobGiver_DefenderReloadTurret:TryGiveJob(Pawn)
Verse.AI.ThinkNode_JobGiver:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
RimWorld.ThinkNode_Duty:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Conditional:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Tagger:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Subtree:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.ThinkNode_Priority:TryIssueJobPackage(Pawn, JobIssueParams)
Verse.AI.Pawn_JobTracker:DetermineNextJob(ThinkTreeDef&)
Verse.AI.Pawn_JobTracker:TryFindAndStartJob()
Verse.AI.Pawn_JobTracker:JobTrackerTick()
Verse.Pawn:Tick()
Verse.TickList:Tick()
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:UpdatePlay()
Verse.Root_Play:Update()
Changes
Fixes the following errors from mech automortars:
Reasoning
Bug that was noticed after #1 but has been there probably since the move to 1.1.
Testing
Check tests you have performed: