Advanced Search

Author Topic: Ammo array condense  (Read 2317 times)

0 Members and 1 Guest are viewing this topic.

November 02, 2015, 04:43:34 AM
Read 2317 times

Offline JaxOf7

  • MM8BDM Extender
  • *****
  • Date Registered: March 23, 2011, 03:56:13 AM

    • View Profile
Ammo array condense
« on: November 02, 2015, 04:43:34 AM »
http://www.best-ever.org/download?file=mm8bdmammoarraycondense.pk3

Ok so there's an array dedicated to the names of weapons and ammo, and then another array dedicated to listing their max ammos  and ammo multipliers.
First off, listing max ammos isn't needed anymore because GetAmmoCapacity is a thing, and using GetAmmoCapacity would allow compatibility with mods that use SetAmmoCapacity.
And ammo multipliers can be inputted as strings in the main array and then read as integers. Maybe that takes up processing? It's certainly more convenient though.

So yeah, just one array. Cool, isn't it?

November 02, 2015, 02:42:48 PM
Reply #1

Offline Messatsu

  • MM8BDM Extender

  • ....
  • *****
  • Date Registered: November 10, 2010, 04:06:39 PM

    • View Profile
Re: Ammo array condense
« Reply #1 on: November 02, 2015, 02:42:48 PM »
I would love to condense the arrays.  One hesitation I have with the suggestion, however, is using strings to store integers.  While this might work, it is not a good coding practice and the potential for unexpected problems to arise concerns me.  I think it SHOULD be possible to remove the 2nd array (and maybe even the buster array) by using GetAmmoCapacity and some expansion on the main array.  I will look into this and see if this can be done.  Thanks for the heads up!

Moved to pending.

December 07, 2015, 06:27:22 AM
Reply #2

Offline Russel

  • MM8BDM Extender

  • Doc Croc
  • ***********
  • Date Registered: December 17, 2010, 11:11:25 PM

    • View Profile
Re: Ammo array condense
« Reply #2 on: December 07, 2015, 06:27:22 AM »
A modification of this suggestion was applied, moved to closed.