Author Topic: A bug in $Substitute feature  (Read 1535 times)

0 Members and 1 Guest are viewing this topic.

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
A bug in $Substitute feature
I think I've found a bug when using $Substitute to add tracers to my gatling gun.
Upon trying to fire the weapon, this happened:
Code: [Select]
Assert: position != NULL
File: weapons.cpp
Line: 4979
'Alpha 1' is trying to fire a weapon that is not selected

<no module>! KiFastSystemCallRet
<no module>! WaitForSingleObject + 18 bytes
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! <no symbol>
<no module>! RegisterWaitForInputIdle + 73 bytes
The reason seems obvious to me, the weapon has $Substitute: set with +frequency: 5 , while the ship has 6 guns. That would have caused the tracer to appear at the very start of firing sequence, a situation which FSO doesn't seem to like. Am I correct?
If I am, could this be fixed?

 

Offline Iss Mneur

  • 210
  • TODO:
Re: A bug in $Substitute feature
I doubt it, that particular assert is usually triggered by you putting the weapon on a turret.

That said, I take it based on your conclusion that if you change the frequency that the assert disappears?
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: A bug in $Substitute feature
No, I didn't had time to do further testing (I based my conclusion on the fact this weapon seems to work on other craft). The ship I'm flying has a turret, but it doesn't use $Substitute (and this turret gun also works, while it's installed on other ship). In fact, I don't think there was anything else that could cause problems. The weapon was a gatling gun (with spinup) and the ship used Chief's weapon linking (which works with $Substitute). I now suspect the spinup, which could have caused a crash on release build, on a different weapon (I ended up not re-checking it on debug due to lack of time). I'm sorry my testing was so lax, but tommorow I'm going to a paramillitary camp and I had to pack everything, so I was quite busy.

  

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: A bug in $Substitute feature
OK, an update.
EDIT: Nevermind, it turned out that the cause was a stupid table error, I accidently left $Substitute in the tracer bullet entry. Now it works.  :)