Author Topic: New bug with shot power  (Read 3988 times)

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
New bug with shot power
« on: November 01, 2005, 09:21:18 AM »
My sim crashed again.

At least this one is completely unrelated to the velocity bug.

It would seem that shot power is sometimes exceeding the realms of decency (32000 that would be)

The culprit routine is "releasebod" in the "shots" module.

find this piece of code near the top of the routine.
Code: [Select]
If SimOpts.EnergyExType Then
   power = Shots(t).nrg / Shots(t).range * Shots(t).value
Else
   power = SimOpts.EnergyFix
End If
and add this line immediately after it.
Code: [Select]
If power > 8000 Then power = 8000
Why 8000 and not 32000?

Because later in this same routine, shots fired by corpses get a 4X multiple. Not really sure why that is. This section was added by Num in one of the recent releases.

Anyway, limiting the power to 8000 prevents the crash.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
New bug with shot power
« Reply #1 on: November 01, 2005, 10:01:48 AM »
I believe the 4x multiple is actually a relic from the origin of body shots.  That is, way before I joined.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
New bug with shot power
« Reply #2 on: November 01, 2005, 10:13:18 AM »
You could be right there. The code is so darn big that us poor programmers can't be expected to remember everything we change.

I may have to go in and re-write that section completely.

Any idea why power is getting so darn big in the first place?
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D

Offline Numsgil

  • Administrator
  • Bot God
  • *****
  • Posts: 7742
    • View Profile
New bug with shot power
« Reply #3 on: November 01, 2005, 10:14:41 AM »
Probably a bot with alot of body.  Or maybe a bot is powering up a shot using shootval.

Offline PurpleYouko

  • Bot God
  • *****
  • Posts: 2556
    • View Profile
New bug with shot power
« Reply #4 on: November 14, 2005, 03:12:02 PM »
Problem fixed by the shot - power / poison bug fix.
There are 10 kinds of people in the world
Those who understand binary.
and those who don't

:D PY :D