Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
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
Bug in get_exp_worth( )
Oct 10, 2017, 1:26 am
By GatewaySysop
Bug in do_drag( )
Oct 8, 2017, 12:40 am
By GatewaySysop
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
Beastmaster 6D sound files
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Google

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
476
3,704
19,231
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Bugfix Lists » SWFOTE FUSS Bugfix List » [Bug] Code will not compile i...
Forum Rules | Mark all | Recent Posts

[Bug] Code will not compile in Cygwin
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Aug 28, 2009, 11:00 am
Go to the top of the page
Go to the bottom of the page

Kayle
Off the Edge of the Map
GroupAdministrators
Posts1,195
JoinedMar 21, 2006

Bug: Code will not compile in Cygwin.
Danger: Major - Code will not compile in Cygwin without these changes.
Found by: Remcon
Fixed by: Remcon
---

Act_move.c
find
short encumbrance( CHAR_DATA * ch, short move )
{
   int cur, max;

   max = can_carry_w( ch );
   cur = ch->carry_weight;
   if( cur >= max )
      return move * 4;
   else if( cur >= max * 0.95 )
      return move * 3.5;
   else if( cur >= max * 0.90 )
      return move * 3;
   else if( cur >= max * 0.85 )
      return move * 2.5;
   else if( cur >= max * 0.80 )
      return move * 2;
   else if( cur >= max * 0.75 )
      return move * 1.5;
   else
      return move;
}

change it to
short encumbrance( CHAR_DATA * ch, short move )
{
   int cur, max;

   max = can_carry_w( ch );
   cur = ch->carry_weight;
   if( cur >= max )
      return ( short )( move * 4 );
   else if( cur >= max * 0.95 )
      return ( short )( move * 3.5 );
   else if( cur >= max * 0.90 )
      return ( short )( move * 3 );
   else if( cur >= max * 0.85 )
      return ( short )( move * 2.5 );
   else if( cur >= max * 0.80 )
      return ( short )( move * 2 );
   else if( cur >= max * 0.75 )
      return ( short )( move * 1.5 );
   else
      return move;
}


Act_obj.c
line 2824 change
      WAIT_STATE( ch, 1.5 * PULSE_VIOLENCE );

to this
      WAIT_STATE( ch, ( int )( 1.5 * PULSE_VIOLENCE ) );


build.c function do_mset
find
   if( !str_cmp( arg2, "level" ) )
   {
      if( !can_mmodify( ch, victim ) )
         return;
      if( !IS_NPC( victim ) )
      {
         send_to_char( "Not on PC's.\r\n", ch );
         return;
      }

      if( value < 0 || value > LEVEL_AVATAR + 5 )
      {
         ch_printf( ch, "Level range is 0 to %d.\r\n", LEVEL_AVATAR + 5 );
         return;
      }
      {
         int ability;
         for( ability = 0; ability < MAX_ABILITY; ability++ )
            victim->skill_level[ability] = value;
      }
      victim->top_level = value;
      victim->armor = 100 - value * 2.5;
      victim->hitroll = value / 5;
      victim->damroll = value / 5;
      if( IS_NPC( victim ) && IS_SET( victim->act, ACT_PROTOTYPE ) )
      {
         victim->pIndexData->level = value;
         victim->pIndexData->ac = 100 - value * 2.5;
         victim->pIndexData->hitroll = victim->hitroll;
         victim->pIndexData->damroll = victim->damroll;
      }
      sprintf( outbuf, "%s damnumdie %d", arg1, value / 10 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s damsizedie %d", arg1, 4 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s damplus %d", arg1, 2 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitnumdie %d", arg1, value / 5 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitsizedie %d", arg1, 10 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitplus %d", arg1, value * 10 );
      do_mset( ch, outbuf );

      return;
   }

change it to this
   if( !str_cmp( arg2, "level" ) )
   {
      if( !can_mmodify( ch, victim ) )
         return;
      if( !IS_NPC( victim ) )
      {
         send_to_char( "Not on PC's.\r\n", ch );
         return;
      }

      if( value < 0 || value > LEVEL_AVATAR + 5 )
      {
         ch_printf( ch, "Level range is 0 to %d.\r\n", LEVEL_AVATAR + 5 );
         return;
      }
      {
         int ability;
         for( ability = 0; ability < MAX_ABILITY; ability++ )
            victim->skill_level[ability] = value;
      }
      victim->top_level = value;
      victim->armor = ( short )( 100 - value * 2.5 );
      victim->hitroll = value / 5;
      victim->damroll = value / 5;
      if( IS_NPC( victim ) && IS_SET( victim->act, ACT_PROTOTYPE ) )
      {
         victim->pIndexData->level = value;
         victim->pIndexData->ac = ( short )( 100 - value * 2.5 );
         victim->pIndexData->hitroll = victim->hitroll;
         victim->pIndexData->damroll = victim->damroll;
      }
      sprintf( outbuf, "%s damnumdie %d", arg1, value / 10 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s damsizedie %d", arg1, 4 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s damplus %d", arg1, 2 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitnumdie %d", arg1, value / 5 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitsizedie %d", arg1, 10 );
      do_mset( ch, outbuf );
      sprintf( outbuf, "%s hitplus %d", arg1, value * 10 );
      do_mset( ch, outbuf );

      return;
   }


Clans.c
function do_gatherclans
find
      for( planet = first_planet; planet; planet = planet->next )
         if( clan == planet->governed_by )
         {
            support += planet->pop_support;
            pCount++;
            revenue += get_taxes( planet );
         }

change it to
      for( planet = first_planet; planet; planet = planet->next )
         if( clan == planet->governed_by )
         {
            support += ( int )planet->pop_support;
            pCount++;
            revenue += get_taxes( planet );
         }


function do_clanstat
find
   for( planet = first_planet; planet; planet = planet->next )
      if( clan == planet->governed_by )
      {
         support += planet->pop_support;
         pCount++;
         revenue += get_taxes( planet );
      }

change it to
   for( planet = first_planet; planet; planet = planet->next )
      if( clan == planet->governed_by )
      {
         support += ( int )planet->pop_support;
         pCount++;
         revenue += get_taxes( planet );
      }


function do_clans
find
      for( planet = first_planet; planet; planet = planet->next )
         if( clan == planet->governed_by )
         {
            support += planet->pop_support;
            pCount++;
            revenue += get_taxes( planet );
         }

change it to
      for( planet = first_planet; planet; planet = planet->next )
         if( clan == planet->governed_by )
         {
            support += ( int )planet->pop_support;
            pCount++;
            revenue += get_taxes( planet );
         }


DB.c
function create_mobile
find
   if( pMobIndex->ac )
      mob->armor = pMobIndex->ac;
   else
      mob->armor = 100 - mob->top_level * 2.5;

change it to
   if( pMobIndex->ac )
      mob->armor = pMobIndex->ac;
   else
      mob->armor = ( short )( 100 - mob->top_level * 2.5 );


Fight.c
line 989
change
         dam *= 1.5;

to
         dam = ( int )( dam * 1.5 );


line 994
change
         dam *= 1.25;

to
         dam = ( int )( dam * 1.25 );


line 1065
change
         dam *= 0.75;

to
         dam = ( int )( dam * 0.75 );


line 1070
change
         dam *= 0.5;

to
         dam = ( int )( dam * 0.5 );


Fskills.c
line 959
change
      victim->hit -= dam * 1.5;

to
      victim->hit -= ( short )( dam * 1.5 );


Handler.c
find
int get_exp_worth( CHAR_DATA * ch )
{
   int wexp;

   wexp = ch->skill_level[COMBAT_ABILITY] * ch->top_level * 50;
   wexp += ch->max_hit * 2;
   wexp -= ( ch->armor - 50 ) * 2;
   wexp += ( ch->barenumdie * ch->baresizedie + GET_DAMROLL( ch ) ) * 50;
   wexp += GET_HITROLL( ch ) * ch->top_level * 10;
   if( IS_AFFECTED( ch, AFF_SANCTUARY ) )
      wexp += wexp * 1.5;
   if( IS_AFFECTED( ch, AFF_FIRESHIELD ) )
      wexp += wexp * 1.2;
   if( IS_AFFECTED( ch, AFF_SHOCKSHIELD ) )
      wexp += wexp * 1.2;
   wexp = URANGE( MIN_EXP_WORTH, wexp, MAX_EXP_WORTH );

   return wexp;
}

change it to
int get_exp_worth( CHAR_DATA * ch )
{
   int wexp;

   wexp = ch->skill_level[COMBAT_ABILITY] * ch->top_level * 50;
   wexp += ch->max_hit * 2;
   wexp -= ( ch->armor - 50 ) * 2;
   wexp += ( ch->barenumdie * ch->baresizedie + GET_DAMROLL( ch ) ) * 50;
   wexp += GET_HITROLL( ch ) * ch->top_level * 10;
   if( IS_AFFECTED( ch, AFF_SANCTUARY ) )
      wexp += ( int )( wexp * 1.5 );
   if( IS_AFFECTED( ch, AFF_FIRESHIELD ) )
      wexp += ( int )( wexp * 1.2 );
   if( IS_AFFECTED( ch, AFF_SHOCKSHIELD ) )
      wexp += ( int )( wexp * 1.2 );
   wexp = URANGE( MIN_EXP_WORTH, wexp, MAX_EXP_WORTH );

   return wexp;
}


Magic.c
line 1650
change
   af.duration = ( 1 + ( level / 3 ) ) * DUR_CONV;

to
   af.duration = ( int )( ( 1 + ( level / 3 ) ) * DUR_CONV );


line 1805
change
   af.duration = 10 * level * DUR_CONV;

to
   af.duration = ( int )( 10 * level * DUR_CONV );


line 1870
change
   af.duration = ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV;

to
   af.duration = ( int )( ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV );


line 2115
change
   af.duration = ( 4 * level ) * DUR_CONV;

to
   af.duration = ( int )( ( 4 * level ) * DUR_CONV );


line 2487
change
   af.duration = level * DUR_CONV;

to
   af.duration = ( int )( level * DUR_CONV );


line 2849
change
      af.duration = ( ( level / 4 ) + 12 ) * DUR_CONV;

to
      af.duration = ( int )( ( ( level / 4 ) + 12 ) * DUR_CONV );


line 3064
change
   af.duration = number_fuzzy( level / 4 ) * DUR_CONV;

to
   af.duration = ( int )( number_fuzzy( level / 4 ) * DUR_CONV );


line 3094
change
   af.duration = level * DUR_CONV;

to
   af.duration = ( int )( level * DUR_CONV );


line 3254
change
   af.duration = ( 4 + level ) * DUR_CONV;

to
   af.duration = ( int )( ( 4 + level ) * DUR_CONV );


line 3339
change
   af.duration = level / 2 * DUR_CONV;

to
   af.duration = ( int )( level / 2 * DUR_CONV );


line 3962
change
      af.duration = ( number_fuzzy( ( level + 1 ) / 4 ) + 1 ) * DUR_CONV;

to
      af.duration = ( int )( ( number_fuzzy( ( level + 1 ) / 4 ) + 1 ) * DUR_CONV );


line 4317
change
   return damage( ch, victim, ( dam * 1.4 ), sn );

to
   return damage( ch, victim, ( int )( dam * 1.4 ), sn );


line 5044
change
   af.duration = ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV;

to
   af.duration = ( int )( ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV );


planets.c
around line 602
find
   if( planet->size > 0 )
   {
      float tempf;

      tempf = planet->citysize;
      pc = tempf / planet->size * 100;

      tempf = planet->wilderness;
      pw = tempf / planet->size * 100;

      tempf = planet->farmland;
      pf = tempf / planet->size * 100;
   }

change it to
   if( planet->size > 0 )
   {
      float tempf;

      tempf = planet->citysize;
      pc = ( int )( tempf / planet->size * 100 );

      tempf = planet->wilderness;
      pw = ( int )( tempf / planet->size * 100 );

      tempf = planet->farmland;
      pf = ( int )( tempf / planet->size * 100 );
   }


find
long get_taxes( PLANET_DATA * planet )
{
   long gain;

   gain = planet->base_value;
   gain += planet->base_value * ( planet->pop_support / 100 );
   gain += ( planet->population * 150 );
   gain += UMAX( 0, planet->pop_support / 10 * ( planet->population * 20 ) );

   return gain;
}

change it to
long get_taxes( PLANET_DATA * planet )
{
   long gain;

   gain = planet->base_value;
   gain += ( long )( planet->base_value * ( planet->pop_support / 100 ) );
   gain += ( planet->population * 150 );
   gain += UMAX( 0, ( int )( planet->pop_support / 10 * ( planet->population * 20 ) ) );

   return gain;
}


Ships.c
line 363
change
   ch->pcdata->clan->funds -= ship_prototypes[ship_type].cost * 1.3;

to
   ch->pcdata->clan->funds -= ( long )( ship_prototypes[ship_type].cost * 1.3 );

line 742
change
                     bmshipcost = ship_prototypes[x].cost * 2.5;

to
                     bmshipcost = ( int )( ship_prototypes[x].cost * 2.5 );


line 746
change
                     bmshipcost = ship_prototypes[x].cost * 1.5;

to
                     bmshipcost = ( int )( ship_prototypes[x].cost * 1.5 );


Skills.c
line 2881
change
      af.duration = ch->skill_level[SMUGGLING_ABILITY] * DUR_CONV;

to
      af.duration = ( int )( ch->skill_level[SMUGGLING_ABILITY] * DUR_CONV );


Space.c
around line 528
find
         if( missile->mx < target->vx )
            missile->mx += UMIN( missile->speed / 5, target->vx - missile->mx );
         else if( missile->mx > target->vx )
            missile->mx -= UMIN( missile->speed / 5, missile->mx - target->vx );
         if( missile->my < target->vy )
            missile->my += UMIN( missile->speed / 5, target->vy - missile->my );
         else if( missile->my > target->vy )
            missile->my -= UMIN( missile->speed / 5, missile->my - target->vy );
         if( missile->mz < target->vz )
            missile->mz += UMIN( missile->speed / 5, target->vz - missile->mz );
         else if( missile->mz > target->vz )
            missile->mz -= UMIN( missile->speed / 5, missile->mz - target->vz );

         if( abs( missile->mx ) - abs( target->vx ) <= 20 && abs( missile->mx ) - abs( target->vx ) >= -20
             && abs( missile->my ) - abs( target->vy ) <= 20 && abs( missile->my ) - abs( target->vy ) >= -20
             && abs( missile->mz ) - abs( target->vz ) <= 20 && abs( missile->mz ) - abs( target->vz ) >= -20 )

change it to
         if( missile->mx < target->vx )
            missile->mx += UMIN( missile->speed / 5, ( int )( target->vx - missile->mx ) );
         else if( missile->mx > target->vx )
            missile->mx -= UMIN( missile->speed / 5, ( int )( missile->mx - target->vx ) );
         if( missile->my < target->vy )
            missile->my += UMIN( missile->speed / 5, ( int )( target->vy - missile->my ) );
         else if( missile->my > target->vy )
            missile->my -= UMIN( missile->speed / 5, ( int )( missile->my - target->vy ) );
         if( missile->mz < target->vz )
            missile->mz += UMIN( missile->speed / 5, ( int )( target->vz - missile->mz ) );
         else if( missile->mz > target->vz )
            missile->mz -= UMIN( missile->speed / 5, ( int )( missile->mz - target->vz ) );

         if( abs( ( int )missile->mx ) - abs( ( int )target->vx ) <= 20 && abs( ( int )missile->mx ) - abs( ( int )target->vx ) >= -20
             && abs( ( int )missile->my ) - abs( ( int )target->vy ) <= 20 && abs( ( int )missile->my ) - abs( ( int )target->vy ) >= -20
             && abs( ( int )missile->mz ) - abs( ( int )target->vz ) <= 20 && abs( ( int )missile->mz ) - abs( ( int )target->vz ) >= -20 )


around line 702
find
      if( ship->starsystem->star1 && strcmp( ship->starsystem->star1, "" ) &&
          abs( ship->vx - ship->starsystem->s1x ) < 10 &&
          abs( ship->vy - ship->starsystem->s1y ) < 10 && abs( ship->vz - ship->starsystem->s1z ) < 10 )

change it to
      if( ship->starsystem->star1 && strcmp( ship->starsystem->star1, "" ) &&
          abs( ( int )( ship->vx - ship->starsystem->s1x ) ) < 10 &&
          abs( ( int )( ship->vy - ship->starsystem->s1y ) ) < 10 && abs( ( int )( ship->vz - ship->starsystem->s1z ) ) < 10 )


around line 712
find
      if( ship->starsystem->star2 && strcmp( ship->starsystem->star2, "" ) &&
          abs( ship->vx - ship->starsystem->s2x ) < 10 &&
          abs( ship->vy - ship->starsystem->s2y ) < 10 && abs( ship->vz - ship->starsystem->s2z ) < 10 )

change it to
      if( ship->starsystem->star2 && strcmp( ship->starsystem->star2, "" ) &&
          abs( ( int )( ship->vx - ship->starsystem->s2x ) ) < 10 &&
          abs( ( int )( ship->vy - ship->starsystem->s2y ) ) < 10 && abs( ( int )( ship->vz - ship->starsystem->s2z ) ) < 10 )


around line 725
find
         if( ship->starsystem->planet1 && strcmp( ship->starsystem->planet1, "" ) &&
             abs( ship->vx - ship->starsystem->p1x ) < 10 &&
             abs( ship->vy - ship->starsystem->p1y ) < 10 && abs( ship->vz - ship->starsystem->p1z ) < 10 )

change it to
         if( ship->starsystem->planet1 && strcmp( ship->starsystem->planet1, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p1x ) ) < 10 &&
             abs( ( int )( ship->vy - ship->starsystem->p1y ) ) < 10 && abs( ( int )( ship->vz - ship->starsystem->p1z ) ) < 10 )


around line 736
find
         if( ship->starsystem->planet2 && strcmp( ship->starsystem->planet2, "" ) &&
             abs( ship->vx - ship->starsystem->p2x ) < 10 &&
             abs( ship->vy - ship->starsystem->p2y ) < 10 && abs( ship->vz - ship->starsystem->p2z ) < 10 )

change it to
         if( ship->starsystem->planet2 && strcmp( ship->starsystem->planet2, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p2x ) ) < 10 &&
             abs( ( int )( ship->vy - ship->starsystem->p2y ) ) < 10 && abs( ( int )( ship->vz - ship->starsystem->p2z ) ) < 10 )


around line 746
find
         if( ship->starsystem->planet3 && strcmp( ship->starsystem->planet3, "" ) &&
             abs( ship->vx - ship->starsystem->p3x ) < 10 &&
             abs( ship->vy - ship->starsystem->p3y ) < 10 && abs( ship->vz - ship->starsystem->p3z ) < 10 )

change it to
         if( ship->starsystem->planet3 && strcmp( ship->starsystem->planet3, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p3x ) ) < 10 &&
             abs( ( int )( ship->vy - ship->starsystem->p3y ) ) < 10 && abs( ( int )( ship->vz - ship->starsystem->p3z ) ) < 10 )


around line 903
find
                  if( ship->shipstate != SHIP_HYPERSPACE && ship->energy > 25
                      && ship->target0->starsystem == ship->starsystem
                      && abs( target->vx - ship->vx ) <= 1000
                      && abs( target->vy - ship->vy ) <= 1000
                      && abs( target->vz - ship->vz ) <= 1000 && ship->primaryState < ship->primaryCount )

change it to
                  if( ship->shipstate != SHIP_HYPERSPACE && ship->energy > 25
                      && ship->target0->starsystem == ship->starsystem
                      && abs( ( int )( target->vx - ship->vx ) ) <= 1000
                      && abs( ( int )( target->vy - ship->vy ) ) <= 1000
                      && abs( ( int )( target->vz - ship->vz ) ) <= 1000 && ship->primaryState < ship->primaryCount )


around line 912
find
                        schance -= ( abs( target->vx - ship->vx ) / 70 );
                        schance -= ( abs( target->vy - ship->vy ) / 70 );
                        schance -= ( abs( target->vz - ship->vz ) / 70 );

change it to
                        schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 70 );
                        schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 70 );
                        schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 70 );


around line 1151
find
            if( target != ship &&
                abs( ship->vx - target->vx ) < target_too_close &&
                abs( ship->vy - target->vy ) < target_too_close && abs( ship->vz - target->vz ) < target_too_close )

change it to
            if( target != ship &&
                abs( ( int )( ship->vx - target->vx ) ) < target_too_close &&
                abs( ( int )( ship->vy - target->vy ) ) < target_too_close && abs( ( int )( ship->vz - target->vz ) ) < target_too_close )


around line 1159
find
         if( ship->starsystem->star1 && strcmp( ship->starsystem->star1, "" ) &&
             abs( ship->vx - ship->starsystem->s1x ) < too_close &&
             abs( ship->vy - ship->starsystem->s1y ) < too_close && abs( ship->vz - ship->starsystem->s1z ) < too_close )

change it to
         if( ship->starsystem->star1 && strcmp( ship->starsystem->star1, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->s1x ) ) < too_close &&
             abs( ( int )( ship->vy - ship->starsystem->s1y ) ) < too_close && abs( ( int )( ship->vz - ship->starsystem->s1z ) ) < too_close )


around line 1168
find
         if( ship->starsystem->star2 && strcmp( ship->starsystem->star2, "" ) &&
             abs( ship->vx - ship->starsystem->s2x ) < too_close &&
             abs( ship->vy - ship->starsystem->s2y ) < too_close && abs( ship->vz - ship->starsystem->s2z ) < too_close )

change it to
         if( ship->starsystem->star2 && strcmp( ship->starsystem->star2, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->s2x ) ) < too_close &&
             abs( ( int )( ship->vy - ship->starsystem->s2y ) ) < too_close && abs( ( int )( ship->vz - ship->starsystem->s2z ) ) < too_close )


around line 1176
find
         if( ship->starsystem->planet1 && strcmp( ship->starsystem->planet1, "" ) &&
             abs( ship->vx - ship->starsystem->p1x ) < too_close &&
             abs( ship->vy - ship->starsystem->p1y ) < too_close && abs( ship->vz - ship->starsystem->p1z ) < too_close )

change it to
         if( ship->starsystem->planet1 && strcmp( ship->starsystem->planet1, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p1x ) ) < too_close &&
             abs( ( int )( ship->vy - ship->starsystem->p1y ) ) < too_close && abs( ( int )( ship->vz - ship->starsystem->p1z ) ) < too_close )


around line 1184
find
         if( ship->starsystem->planet2 && strcmp( ship->starsystem->planet2, "" ) &&
             abs( ship->vx - ship->starsystem->p2x ) < too_close &&
             abs( ship->vy - ship->starsystem->p2y ) < too_close && abs( ship->vz - ship->starsystem->p2z ) < too_close )

change it to
         if( ship->starsystem->planet2 && strcmp( ship->starsystem->planet2, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p2x ) ) < too_close &&
             abs( ( int )( ship->vy - ship->starsystem->p2y ) ) < too_close && abs( ( int )( ship->vz - ship->starsystem->p2z ) ) < too_close )


around line 1192
find
         if( ship->starsystem->planet3 && strcmp( ship->starsystem->planet3, "" ) &&
             abs( ship->vx - ship->starsystem->p3x ) < too_close &&
             abs( ship->vy - ship->starsystem->p3y ) < too_close && abs( ship->vz - ship->starsystem->p3z ) < too_close )

change it to
         if( ship->starsystem->planet3 && strcmp( ship->starsystem->planet3, "" ) &&
             abs( ( int )( ship->vx - ship->starsystem->p3x ) ) < too_close &&
             abs( ( int )( ship->vy - ship->starsystem->p3y ) ) < too_close && abs( ( int )( ship->vz - ship->starsystem->p3z ) ) < too_close )


around line 1246
find
         if( target != ship && ship->shipstate == SHIP_READY &&
             abs( ship->vx - target->vx ) < target_too_close &&
             abs( ship->vy - target->vy ) < target_too_close && abs( ship->vz - target->vz ) < target_too_close )

change it to
         if( target != ship && ship->shipstate == SHIP_READY &&
             abs( ( int )( ship->vx - target->vx ) ) < target_too_close &&
             abs( ( int )( ship->vy - target->vy ) ) < target_too_close && abs( ( int )( ship->vz - target->vz ) ) < target_too_close )


around line 1318
find
               if( ship->shipstate != SHIP_HYPERSPACE && ship->energy > 25
                   && ship->missilestate == MISSILE_READY && ship->target0->starsystem == ship->starsystem
                   && abs( target->vx - ship->vx ) <= 1200
                   && abs( target->vy - ship->vy ) <= 1200 && abs( target->vz - ship->vz ) <= 1200 && ship->missiles > 0 )

change it to
               if( ship->shipstate != SHIP_HYPERSPACE && ship->energy > 25
                   && ship->missilestate == MISSILE_READY && ship->target0->starsystem == ship->starsystem
                   && abs( ( int )( target->vx - ship->vx ) ) <= 1200
                   && abs( ( int )( target->vy - ship->vy ) ) <= 1200 && abs( ( int )( target->vz - ship->vz ) ) <= 1200 && ship->missiles > 0 )


around line 1326
find
                     schance -= ( abs( target->vx - ship->vx ) / 100 );
                     schance -= ( abs( target->vy - ship->vy ) / 100 );
                     schance -= ( abs( target->vz - ship->vz ) / 100 );

change it to
                     schance -= ( abs( ( int )( target->vx - ship->vx ) / 100 ) );
                     schance -= ( abs( ( int )( target->vy - ship->vy ) / 100 ) );
                     schance -= ( abs( ( int )( target->vz - ship->vz ) / 100 ) );


around line 4937
find
   missile->mx = ship->vx;
   missile->my = ship->vy;
   missile->mz = ship->vz;

change it to
   missile->mx = ( int )ship->vx;
   missile->my = ( int )ship->vy;
   missile->mz = ( int )ship->vz;


around line 7077
find
   if( abs( target->vx - ship->vx ) > 500 + ship->sensor * 2 ||
       abs( target->vy - ship->vy ) > 500 + ship->sensor * 2 || abs( target->vz - ship->vz ) > 500 + ship->sensor * 2 )

change it to
   if( abs( ( int )( target->vx - ship->vx ) ) > 500 + ship->sensor * 2 ||
       abs( ( int )( target->vy - ship->vy ) ) > 500 + ship->sensor * 2 || abs( ( int )( target->vz - ship->vz ) ) > 500 + ship->sensor * 2 )


around line 7446
find
   if( abs( target->vx - ship->vx ) > 500 + ship->sensor * 2 ||
       abs( target->vy - ship->vy ) > 500 + ship->sensor * 2 || abs( target->vz - ship->vz ) > 500 + ship->sensor * 2 )

change it to
   if( abs( ( int )( target->vx - ship->vx ) ) > 500 + ship->sensor * 2 ||
       abs( ( int )( target->vy - ship->vy ) ) > 500 + ship->sensor * 2 || abs( ( int )( target->vz - ship->vz ) ) > 500 + ship->sensor * 2 )


around line 7711
find
      if( abs( eShip->vx - ship->vx ) < 500
          && abs( eShip->vy - ship->vy ) < 500 && abs( eShip->vz - ship->vz ) < 500 && eShip->sclass > SHIP_CRUISER )

change it to
      if( abs( ( int )( eShip->vx - ship->vx ) ) < 500
          && abs( ( int )( eShip->vy - ship->vy ) ) < 500 && abs( ( int )( eShip->vz - ship->vz ) ) < 500 && eShip->sclass > SHIP_CRUISER )


around line 7857
find
         if( abs( ship->vx - target->vx ) > 5000 ||
             abs( ship->vy - target->vy ) > 5000 || abs( ship->vz - target->vz ) > 5000 )

change it to
         if( abs( ( int )( ship->vx - target->vx ) ) > 5000 ||
             abs( ( int )( ship->vy - target->vy ) ) > 5000 || abs( ( int )( ship->vz - target->vz ) ) > 5000 )


line 8101
change
      if( abs( target->vx - ship->vx ) > 1000 || abs( target->vy - ship->vy ) > 1000 || abs( target->vz - ship->vz ) > 1000 )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > 1000 || abs( ( int )( target->vy - ship->vy ) ) > 1000 || abs( ( int )( target->vz - ship->vz ) ) > 1000 )


around line 8154
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


around line 8329
change
      if( abs( target->vx - ship->vx ) > range ||
          abs( target->vy - ship->vy ) > range || abs( target->vz - ship->vz ) > range )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > range ||
          abs( ( int )( target->vy - ship->vy ) ) > range || abs( ( int )( target->vz - ship->vz ) ) > range )


around line 8381
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


line 8529
change
      if( abs( target->vx - ship->vx ) > 1000 || abs( target->vy - ship->vy ) > 1000 || abs( target->vz - ship->vz ) > 1000 )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > 1000 || abs( ( int )( target->vy - ship->vy ) ) > 1000 || abs( ( int )( target->vz - ship->vz ) ) > 1000 )


around line 8540
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


line 8612
change
      if( abs( target->vx - ship->vx ) > 1000 || abs( target->vy - ship->vy ) > 1000 || abs( target->vz - ship->vz ) > 1000 )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > 1000 || abs( ( int )( target->vy - ship->vy ) ) > 1000 || abs( ( int )( target->vz - ship->vz ) ) > 1000 )


around line 8623
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


line 8696
change
      if( abs( target->vx - ship->vx ) > 800 || abs( target->vy - ship->vy ) > 800 || abs( target->vz - ship->vz ) > 800 )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > 800 || abs( ( int )( target->vy - ship->vy ) ) > 800 || abs( ( int )( target->vz - ship->vz ) ) > 800 )


around line 8707
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


line 9038
change
      if( abs( target->vx - ship->vx ) > 1000 || abs( target->vy - ship->vy ) > 1000 || abs( target->vz - ship->vz ) > 1000 )

to
      if( abs( ( int )( target->vx - ship->vx ) ) > 1000 || abs( ( int )( target->vy - ship->vy ) ) > 1000 || abs( ( int )( target->vz - ship->vz ) ) > 1000 )


around line 9084
change
      schance -= ( abs( target->vx - ship->vx ) / 100 );
      schance -= ( abs( target->vy - ship->vy ) / 100 );
      schance -= ( abs( target->vz - ship->vz ) / 100 );

to
      schance -= ( abs( ( int )( target->vx - ship->vx ) ) / 100 );
      schance -= ( abs( ( int )( target->vy - ship->vy ) ) / 100 );
      schance -= ( abs( ( int )( target->vz - ship->vz ) ) / 100 );


around line 9257
change
      if( starsystem2->star1 && strcmp( starsystem2->star1, "" ) &&
          abs( ship->jx - starsystem2->s1x ) < 300 &&
          abs( ship->jy - starsystem2->s1y ) < 300 && abs( ship->jz - starsystem2->s1z ) < 300 )

to
      if( starsystem2->star1 && strcmp( starsystem2->star1, "" ) &&
          abs( ( int )( ship->jx - starsystem2->s1x ) ) < 300 &&
          abs( ( int )( ship->jy - starsystem2->s1y ) ) < 300 && abs( ( int )( ship->jz - starsystem2->s1z ) ) < 300 )


around line 9266
change
      else if( starsystem2->star2 && strcmp( starsystem2->star2, "" ) &&
               abs( ship->jx - starsystem2->s2x ) < 300 &&
               abs( ship->jy - starsystem2->s2y ) < 300 && abs( ship->jz - starsystem2->s2z ) < 300 )

to
      else if( starsystem2->star2 && strcmp( starsystem2->star2, "" ) &&
               abs( ( int )( ship->jx - starsystem2->s2x ) ) < 300 &&
               abs( ( int )( ship->jy - starsystem2->s2y ) ) < 300 && abs( ( int )( ship->jz - starsystem2->s2z ) ) < 300 )


around line 9275
change
      else if( starsystem2->planet1 && strcmp( starsystem2->planet1, "" ) &&
               abs( ship->jx - starsystem2->p1x ) < 300 &&
               abs( ship->jy - starsystem2->p1y ) < 300 && abs( ship->jz - starsystem2->p1z ) < 300 )

to
      else if( starsystem2->planet1 && strcmp( starsystem2->planet1, "" ) &&
               abs( ( int )( ship->jx - starsystem2->p1x ) ) < 300 &&
               abs( ( int )( ship->jy - starsystem2->p1y ) ) < 300 && abs( ( int )( ship->jz - starsystem2->p1z ) ) < 300 )


around line 9284
change
      else if( starsystem2->planet2 && strcmp( starsystem2->planet2, "" ) &&
               abs( ship->jx - starsystem2->p2x ) < 300 &&
               abs( ship->jy - starsystem2->p2y ) < 300 && abs( ship->jz - starsystem2->p2z ) < 300 )

to
      else if( starsystem2->planet2 && strcmp( starsystem2->planet2, "" ) &&
               abs( ( int )( ship->jx - starsystem2->p2x ) ) < 300 &&
               abs( ( int )( ship->jy - starsystem2->p2y ) ) < 300 && abs( ( int )( ship->jz - starsystem2->p2z ) ) < 300 )


around line 9293
change
      else if( starsystem2->planet3 && strcmp( starsystem2->planet3, "" ) &&
               abs( ship->jx - starsystem2->p3x ) < 300 &&
               abs( ship->jy - starsystem2->p3y ) < 300 && abs( ship->jz - starsystem2->p3z ) < 300 )

to
      else if( starsystem2->planet3 && strcmp( starsystem2->planet3, "" ) &&
               abs( ( int )( ship->jx - starsystem2->p3x ) ) < 300 &&
               abs( ( int )( ship->jy - starsystem2->p3y ) ) < 300 && abs( ( int )( ship->jz - starsystem2->p3z ) ) < 300 )


Special.c
line 774
change
                  victim->gold = victim->gold * .75;

to
                  victim->gold = ( int )( victim->gold * .75 );


line 780
change
                  victim->gold = victim->gold * .9;

to
                  victim->gold = ( int )( victim->gold * .9 );


line 855
change
               victim->gold = victim->gold * .75;

to
               victim->gold = ( int )( victim->gold * .75 );


line 861
change
               victim->gold = victim->gold * .9;

to
               victim->gold = ( int )( victim->gold * .9 );


Swskills.c
line 2858
change
         mob[mob_cnt]->armor = 100 - mob[mob_cnt]->top_level * 2.5;

to
         mob[mob_cnt]->armor = ( int )( 100 - mob[mob_cnt]->top_level * 2.5 );


line 2898
change
      mob->armor = 100 - mob->top_level * 2.5;

to
      mob->armor = ( int )( 100 - mob->top_level * 2.5 );


line 4808
change
      planet->pop_support += URANGE( 0.1, amount / 1000, 2 );

to
 
      planet->pop_support += URANGE( 1, amount / 1000, 2 ); /* ( int )0.1 would be pointless */


line 4901
change
   af.duration = ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV;

to
   af.duration = ( int )( ( number_fuzzy( ( level + 1 ) / 3 ) + 1 ) * DUR_CONV );


line 6519
change
         af.duration = ( number_fuzzy( ( ch->pcdata->learned[gsn_battle_command] + 1 ) / 3 ) + 1 ) * DUR_CONV;

to
         af.duration = ( int )( ( number_fuzzy( ( ch->pcdata->learned[gsn_battle_command] + 1 ) / 3 ) + 1 ) * DUR_CONV );


Update.c
line 754
change
            gain += get_curr_con( ch ) * 1.5;

to
            gain += ( int )( get_curr_con( ch ) * 1.5 );


line 816
change
            gain += get_curr_int( ch ) * 1.5;

to
            gain += ( int )( get_curr_int( ch ) * 1.5 );


line 1902
change
            amount = ch->pcdata->bank * .02;

to
            amount = ( int )( ch->pcdata->bank * .02 );


line 2723
change
      pulse_point = number_range( PULSE_TICK * 0.75, PULSE_TICK * 1.25 );

to
      pulse_point = number_range( ( int )( PULSE_TICK * 0.75 ), ( int) ( PULSE_TICK * 1.25 ) );


around line 3168
change
            pay = ( int )auction->bet * 0.9;
            tax = ( int )auction->bet * 0.1;

to
            pay = ( int )( auction->bet * 0.9 );
            tax = ( int )( auction->bet * 0.1 );


line 3189
change
            tax = ( int )auction->item->cost * 0.05;

to
            tax = ( int )( auction->item->cost * 0.05 );


Stole Remcon's post, fancified it, and posted it as the bugfix, because there were a lot of changes and I didn't want to re-type them out. >.>
       
Pages:<< prev 1 next >>