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, Yahoo!, Majestic-12, Google, Yandex

Members: 0
Guests: 16
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 » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Planet base_value is us...
Forum Rules | Mark all | Recent Posts

[Bug] Planet base_value is used but never set
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Dec 21, 2008, 5:54 pm
Go to the top of the page
Go to the bottom of the page

Keberus
Conjurer
GroupFUSS Project Team
Posts341
JoinedJun 4, 2005

Bug: Planet base_value is used but never set.
Danger: Medium - Clans may recieve way to much money, throwing off game balance.
Found by: Killien
Fixed by: Keberus

---


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 );
        return;
    }


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 );
        return;
    }


Then locate:
    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;
    }



planets.c, do_showplanet

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) );


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) );



planets.c, save_planet

Find:
        fprintf( fp, "Type         %d\n",       planet->controls );
        fprintf( fp, "PopSupport   %d\n",       (int) (planet->pop_support)      );



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)      );



planets.c, fread_planet

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


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



mud.h, struct planet_data

Locate:
    long             base_value;


Change it to:
    int             base_value;


Then locate:
#define MAX_RACE                   41


After it add:
#define MAX_PLANET_BASE_VALUE     100000



This fix adds makes it so you can set the base_value of any planet and see the value in show_planet.
It also makes sure that the base_value will be saved and read in properly through save_planet and fread_planet.
I chose to set the maximum base_value to 100,000, but if you want you can raise at your discretion.

NOTE: After applying this fix you need to go through all your planets and set a base_value for them.
       
Pages:<< prev 1 next >>