Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Bing, Yahoo!, Google, DotBot

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » SWFOTE FUSS » Base value is used when calcu...
Forum Rules | Mark all | Recent Posts

Base value is used when calculating revenue but can't be set
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Jun 29, 2008, 3:01 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Basically, what the subject says. Revenue uses planet->base_value, but its never set or loaded anywhere so you have no idea what it might be.

Bug Found by: Killien
Bug Fixed by: Keberus

Here's the fix

in planets.c do_setplanet find:
    
if ( arg1[0] == '\0' )
    {
        send_to_char( "Usage: setplanet <planet> <field> [value]\n\r", ch );
        send_to_char( "\n\rField being one of:\n\r", ch );
        send_to_char( " name filename area starsystem governed_by x y z\n\r", ch );
#ifdef USECARGO
        send_to_char( " import  export   resource   produces  consumes\n\r", ch );
#endif
        return;
    }

and change to:
    if ( arg1[0] == '\0' )
    {
        send_to_char( "Usage: setplanet <planet> <field> [value]\n\r", ch );
        send_to_char( "\n\rField being one of:\n\r", ch );
        send_to_char( " name filename area base_value starsystem governed_by x y z\n\r", ch );
#ifdef USECARGO
        send_to_char( " import  export   resource   produces  consumes\n\r", ch );
#endif
        return;
    }



then find:
    if( !strcmp( arg2, "name" ) )
    {
        STRFREE( planet->name );
        planet->name = STRALLOC( argument );
        send_to_char( "Done.\n\r", ch );
        save_planet( planet );
        return;
    }


after it add:
    if( !strcmp( arg2, "base_value" ) )
    {
        int bval;

        bval = atoi( argument );

        if( (bval < 1) || (bval > MAX_PLANET_BASE_VALUE) )
        {
           ch_printf( ch, "&YPlanet base values range from &W%d &Yto &W%d&Y!\n\r", 1, MAX_PLANET_BASE_VALUE );
           return;
        }
        planet->base_value = bval;
        send_to_char( "Done.\n\r", ch );
        save_planet( planet );
        write_planet_list(  );
        return;
    }

in planets.c show_planet find:
    ch_printf( ch, "&WPopular Support: &G%.2f\n\r", planet->pop_support );
    ch_printf( ch, "&WCurrent Monthly Revenue: &G%ld\n\r", get_taxes( planet) );


and change to:
    ch_printf( ch, "&WPopular Support: &G%.2f\n\r", planet->pop_support );
    ch_printf( ch, "&WBase Value: &G%d\n\r", planet->base_value );
    ch_printf( ch, "&WCurrent Monthly Revenue: &G%ld\n\r", get_taxes( planet) );


in planets.c save_planet find:
        fprintf( fp, "Type         %d\n",       planet->controls );
        fprintf( fp, "PopSupport   %d\n",       (int) (planet->pop_support)      );



and change to:
        fprintf( fp, "Type          %d\n",       planet->controls );
        fprintf( fp, "BaseValue    %d\n",       planet->base_value );
        fprintf( fp, "PopSupport   %d\n",       (int) (planet->pop_support)      );


in planet.c fread_planet before:
        case 'E':
            if ( !str_cmp( word, "End" ) )
            {
                if (!planet->name)
                  planet->name          = STRALLOC( "" );
                return;
            }
            break;


add this:
           case 'B':
               KEY( "BaseValue", planet->base_value, fread_number( fp ) );
               break;


in mud.h, struct planet_data change:
    long             base_value;


to:
    int             base_value;


in mud.h after the line:
#define MAX_RACE                   41


add:
#define MAX_PLANET_BASE_VALUE     100000



That should be all she wrote.

And yeah, it would be a good idea after applying this fix to go through all your planets and set a base_value for them.
       
Pages:<< prev 1 next >>