Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2008, 01:42:11 pm

Login with username, password and session length
Check out XenoCorp.Net's FTP site !! Over 10 GB of gaming files for your downloading pleasure: ftp.xenocorp.net
692543 Posts in 49597 Topics by 2957 Members
Latest Member: Jasoneagle
* Home Help Search Calendar Login Register
Dynaverse.net  |  Taldrenites  |  Starfleet Command Mission Scripting  |  Topic: mGetShipBPV() does not work - here is the fix for it 0 Members and 0 Guests are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: mGetShipBPV() does not work - here is the fix for it  (Read 1256 times)
FPF-SCM_TraceyG_XC
Empress of the Empire
Global Moderator
Commander
*
Offline Offline

Gender: Female
Posts: 2543



mGetShipBPV() does not work - here is the fix for it
« on: December 22, 2004, 11:05:14 am »

ship->mGetShipBPV() always returns zero, however, the protected member fShipBPV is being initialised to the correct BPV.

Looking in shipinfo.cpp, we find that function does nothing and only has the one line that says "return 0". Since  fShipBPV is a protected member, we cannot access it outside of the class, nor do we have the source code to the API to make the correct change and recompile it.

However, we can write a new function and add it to shipinfo.h as part of the tShipInfo class by using an inline function

In order to access it, you must make the following changes to the OP API in ShipInfo.h, you will need to change the properties of the file first so it is not set to read only in order to save the chanes.

In  class tShipInfo   : public tActor find the section of code which looks like this:

   //
   //   BPV values
   //
   int32   mGetBPV( void );
   int32   mGetTotalBPV( void );


and change it to:

   //
   //   BPV values
   //
   int32   mGetBPV( void );

   inline int32 mGetRealBPV() // this function added by TraceyG
   {
      return fShipBPV;
   }

   int32   mGetTotalBPV( void );

This adds in a new inline function without the need to recompile ShipInfo.cpp

Once you have done this, you can then use the function ship->mGetRealBPV() just as you would have used mGetBPV(), only now it will return the correct value.
Logged

Captain FPF-TraceyG, Federation Protection Fleet


SFC2.net Admin member
SFC3.net Admin member
Voting member of the DGA
Member of XenoCorp, Squadron Commodore
FA Frey XC
Site Owner
Administrator
Commander
*
Online Online

Gender: Male
Posts: 4681



WWW
Re: mGetShipBPV() does not work - here is the fix for it
« Reply #1 on: December 22, 2004, 11:07:31 am »

Nice work Tracey!
Logged



Vice President of Technology,
Dynaverse Gaming Association
Owner, CEO XenoCorp Inc.
Gamespy Callsigh : FA_Frey_XC

DEFINITION :

CHEESMA [noun]: A highly ionized gaseous cloud of cheese that eminates from whatever Stoney, kougar or Merlin are flying.
FPF-SCM_TraceyG_XC
Empress of the Empire
Global Moderator
Commander
*
Offline Offline

Gender: Female
Posts: 2543



Re: mGetShipBPV() does not work - here is the fix for it
« Reply #2 on: September 09, 2006, 06:16:47 am »

Bump for Dave
Logged

Captain FPF-TraceyG, Federation Protection Fleet


SFC2.net Admin member
SFC3.net Admin member
Voting member of the DGA
Member of XenoCorp, Squadron Commodore
Pages: [1] Print 
Dynaverse.net  |  Taldrenites  |  Starfleet Command Mission Scripting  |  Topic: mGetShipBPV() does not work - here is the fix for it « previous next »
Jump to:  

Powered by MySQL Powered by PHP Dynaverse.net | Powered by SMF 1.0.15.
© 2001-2008, Lewis Media. All Rights Reserved.
Valid XHTML 1.0! Valid CSS!
Page created in 0.285 seconds with 22 queries.