self.Magazine is nil in Create()
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Start with Data/Browncoats.rte/Devices/Weapons/Extinction/Extinction.lua and the reported Create() call that accesses self.Magazine; compare its fallback with the failing mod's INI magazine setup. Use the supplied mods and benchmark activity to reproduce the intermittent nil value at startup, then trace where the magazine is initialized. Done means the cause is identified and self.Magazine is reliably available when Create() uses it.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
self.Magazine can seemingly randomly be nil in Create()
Pawnis' recent Browncoat script even points it out with a comment, in Data/Browncoats.rte/Devices/Weapons/Extinction/Extinction.lua:
self.maxAmmoCount = self.Magazine and self.Magazine.Capacity or 5; -- loading a game might mess this up, so... fall-back
In the mod I found the issue, the error originates from here:
function Create(self)
self.ammoCounter = 100
self.recoil = 0
self.ff = false
print(self.Magazine)
self.f0 = ToMagazine(self.Magazine).RoundCount
self.f1 = ToMagazine(self.Magazine).RoundCount
self.firetimer = Timer()
end
I added the print(self.Magazine), and it shows that self.Magazine is nil a portion of the time it gets printed here.
Where the single ini file where it's used looks roughly like this:
AddAmmo = Magazine
PresetName = Magazine ChainChoppa
AddDevice = HDFirearm
PresetName = Chain Choppa
ScriptPath = orks.rte/Weapons/ChainChoppa/ChainChoppa.lua
Magazine = Magazine
CopyOf = Magazine ChainChoppa
To Reproduce
I haven't taken the time to make a Minimal Reproducible Example yet, but this should show the error after a minute or two of running:
- Download orks.rte.zip
- Download Benchmark.rte.zip
- Use this in your Settings.ini to instantly have the issue printed when the game boots:
LaunchIntoActivity = 1
DefaultActivityType = GAScripted
DefaultActivityName = Combat Benchmark
DefaultSceneName = Benchmark
- Vorherrschende Sprache
- C++
- Sterne
- 329
- Forks
- 47
- Ø Merge
- 6 T. 10 Std.
- Gemergte PRs (30 T.)
- 14
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus cortex-command-community/Cortex-Command-Community-Project
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
cortex-command-community/Cortex-Command-Community-Project#315 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 87/100
cortex-command-community/Cortex-Command-Community-Project#301 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 50/100
cortex-command-community/Cortex-Command-Community-Project#316 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 57/100
cortex-command-community/Cortex-Command-Community-Project#314 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 55/100
cortex-command-community/Cortex-Command-Community-Project#313 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in cortex-command-community/Cortex-Command-Community-Project
Ähnliche Issues
-
backlog documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
EchoTools/nevr-runtime#1328 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Component - Build
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Description of the bugOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
HarbourMasters/Lighthouse#655 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug-unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
wazuh/wazuh#40870 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag