[ScryMUD] SVN Commit Info r936 - trunk/mud/grrmud/server

scrymud at wanfear.com scrymud at wanfear.com
Sun Jun 10 06:46:59 PDT 2007


Author: gingon
Date: 2007-06-10 06:46:58 -0700 (Sun, 10 Jun 2007)
New Revision: 936

Modified:
   trunk/mud/grrmud/server/command2.cc
   trunk/mud/grrmud/server/command5.cc
   trunk/mud/grrmud/server/commands.cc
   trunk/mud/grrmud/server/critter.cc
   trunk/mud/grrmud/server/misc.cc
   trunk/mud/grrmud/server/misc2.cc
   trunk/mud/grrmud/server/misc2.h
   trunk/mud/grrmud/server/weather.cc
   trunk/mud/grrmud/server/weather.h
Log:
Last of the major weather changes. weights updated. Added small chance of lights being blown out by wind on weather change and movement. The camping skill now reduces the negative regen effects of weather. High temperatures will cause you to become thirsty faster. Extremely high winds may blow flying creatures off course. Blizzards and sandstorms affect visibility. Disabled light snow, heavy snow and blizzard from being set via setweather command for safety reasons.

Modified: trunk/mud/grrmud/server/command2.cc
===================================================================
--- trunk/mud/grrmud/server/command2.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/command2.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -555,7 +555,7 @@
 
       dest = abs(door_p->destination);
 
-      if ( detect(pc.getSeeBit(), door_p->getVisBit()) ) {
+	  if ( pc.canSee(*door_p)){  //detect(pc.getSeeBit(), door_p->getVisBit()) ) {
 
          can_see = true;
 

Modified: trunk/mud/grrmud/server/command5.cc
===================================================================
--- trunk/mud/grrmud/server/command5.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/command5.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -3495,7 +3495,6 @@
 }
 
 int setweather(const String* climate_str, const String* weather_str, critter& pc){
-
 	if(pc.pc && pc.pc->imm_data){
 		int c =0,w = 0;
 		if(climate_str->Strlen() && weather_str->Strlen()){  
@@ -3519,6 +3518,10 @@
 				pc.show("error: unknown weather type.\n");
 				return -1;
 			}
+			if(int_to_weather_enum(w) == blizzard || int_to_weather_enum(w) == heavysnow || int_to_weather_enum(w) == lightsnow){
+				pc.show("For safety reasons, you cannot force snow.");
+				return -1;
+			}
 			weather.changeWeather((ClimateType)c,(WeatherType)w);
 		}
 		else pc.show("You must specify a climate type and weather type\n");

Modified: trunk/mud/grrmud/server/commands.cc
===================================================================
--- trunk/mud/grrmud/server/commands.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/commands.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -47,6 +47,7 @@
 #include "load_wld.h"
 #include "Filters.h"
 #include "clients.h"
+#include "weather.h"
 
 int inventory(critter& pc) {
    String buf(100);
@@ -2871,9 +2872,15 @@
       }
       str_dir = *(rm.getRandomExitDir(pc));
    }//IF
+  if(pc.isFlying() && rm.hasWeather() && (weather.climates[rm.getWeather()].wind == gale) &&
+    (rand()%100 <= 5)){ // be nice and set it to a low val
+	   str_dir = *(rm.getRandomExitDir(pc));
+	   pc.show("The fierce winds have blown you away from your intended destination!\n");
+   }
 
+
    if (pc.MOV < 1) {
-      pc.show(CS_MOVE_NO_MOV);
+	   pc.show(CS_MOVE_NO_MOV);
    }//if
    else if (pc.POS != POS_STAND) {
       pc.show(CS_MOV_STANDING);
@@ -3043,7 +3050,7 @@
                from_dir = "below";
             }
          }//if
-
+		 blow_out_lights(&pc, true);
          pc.doGoToRoom(dest, from_dir, door_ptr, is_dead, rm.getIdNum(), 1);
 
          if (is_dead) {

Modified: trunk/mud/grrmud/server/critter.cc
===================================================================
--- trunk/mud/grrmud/server/critter.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/critter.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -6006,22 +6006,29 @@
 }
 
 bool critter::canSee(critter& mob){
-	/*//see if the weather messes with our vision
-	if( w && ((room_list[IN_ROOM].getWeather() == sandstorm) || room_list[IN_ROOM].getWeather() == blizzard)){ 
-		if(rand()%100 >70) return false;
-	}*/
+	//see if the weather messes with our vision
+	if(((room_list[IN_ROOM].getWeather() == sandstorm) || room_list[IN_ROOM].getWeather() == blizzard)){ 
+		if(rand()%100 <=25) return false;
+	}
   if(detect(getSeeBit(),mob.getVisBit())){
      return true;
   }
   return false;
 }
 bool critter::canSee(int vis_bit){
+/*	if(((room_list[IN_ROOM].getWeather() == sandstorm) || room_list[IN_ROOM].getWeather() == blizzard)){ 
+		if(rand()%100 >25) return false;
+	}*/
+	//don't do weather for vis_bit
    if(detect(getSeeBit(), vis_bit)){
       return true;
    }
    return false;
 }
 bool critter::canSee(object& obj){
+	if(((room_list[IN_ROOM].getWeather() == sandstorm) || room_list[IN_ROOM].getWeather() == blizzard)){ 
+		if(rand()%100 <=25) return false;
+	}
    if(detect(getSeeBit(), obj.getVisBit())){
       return true;
    }
@@ -6029,6 +6036,9 @@
 }
 
 bool critter::canSee(door& dr){
+	if(((room_list[IN_ROOM].getWeather() == sandstorm) || room_list[IN_ROOM].getWeather() == blizzard)){ 
+		if(rand()%100 <=25) return false;
+	}
    if(detect(getSeeBit(), dr.getVisBit())){
       return true;
    }

Modified: trunk/mud/grrmud/server/misc.cc
===================================================================
--- trunk/mud/grrmud/server/misc.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/misc.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -465,7 +465,7 @@
 //that never regen. I'll be watching the effects of this change closely and
 //will most likely adjust the algorithms based on what I discover.
 void do_regeneration_pcs() {
-   float adj = 1.0, posn_mod, align_mod = 1.0, env_mod = 1.0;
+   float adj = 1.0, posn_mod, align_mod = 1.0, weather_mod = 1.0, temperature_mod = 1.0, env_mod = 1.0;
    Cell<critter*> crit_cell;
    pc_list.head(crit_cell);
    critter* crit_ptr;
@@ -475,8 +475,8 @@
    while ((crit_ptr = crit_cell.next())) {
 
 	  if(crit_ptr->getCurRoom()->getWeather()!= wNONE){
-            env_mod = weather_regen_mods[crit_ptr->getCurRoom()->getWeather()] *
-            temperature_regen_mods[crit_ptr->getCurRoom()->getTemperature()];
+            weather_mod = weather_regen_mods[crit_ptr->getCurRoom()->getWeather()];
+			temperature_mod = temperature_regen_mods[crit_ptr->getCurRoom()->getTemperature()];
       }
       //no regen if we're fighting
       if ( crit_ptr->isFighting() ) {
@@ -496,8 +496,9 @@
       else {
          if ((crit_ptr->POS > POS_SIT) &&
              room_list[crit_ptr->getCurRoomNum()].canCamp()) {
-            adj *= ((float)(200 + get_percent_lrnd(CAMPING_SKILL_NUM,
-                                                   *crit_ptr))) / 200.0;
+				 float camp = get_percent_lrnd(CAMPING_SKILL_NUM, *crit_ptr) / 200;
+				 env_mod *= (temperature_mod+((camp*(1.0 - temperature_mod))/2));
+				 env_mod *= (weather_mod+(camp*(1.0 - weather_mod)));
          }//if camping is an issue
 
          posn_mod = (2.0 + (float)(crit_ptr->POS)) / 4.0;
@@ -1330,8 +1331,16 @@
 
          if (crit_ptr->HUNGER > 0)
             crit_ptr->HUNGER--;  //food
-         if (crit_ptr->THIRST > 0)
-            crit_ptr->THIRST--;  //drink
+		 if (crit_ptr->THIRST > 0){
+			 room* rm = crit_ptr->getCurRoom();
+			 if(rm->hasWeather() && (weather.climates[rm->getClimate()].temperature == veryhot || 
+				 weather.climates[rm->getClimate()].temperature == burninghot)){
+					 //use more water in high temp
+					 crit_ptr->THIRST--;
+				 }
+				 crit_ptr->THIRST--;  //drink
+				 if(crit_ptr->THIRST < 0) crit_ptr->THIRST = 0;
+		 }
          if (crit_ptr->DRUGGED > 0)
             crit_ptr->DRUGGED--;  //drugged
          if (crit_ptr->isViolent()) { // violence timer
@@ -2051,7 +2060,7 @@
          mudlog << "out_crit: got critter:  " << *(crit_ptr->getName())
                 << endl;
       }
-      if (detect(see_bits, crit_ptr->VIS_BIT) &&
+	  if (pc.canSee(*crit_ptr) &&  //detect(see_bits, crit_ptr->VIS_BIT) &&
           (crit_ptr != &pc)) { //can see it, not looker
          if ((crit_ptr->isHiding()) && //if is hiding
              (d(1, pc.LEVEL + 30) < 
@@ -2349,7 +2358,7 @@
       case ROOM_INV:
          while ((obj_ptr = cell.next())) {
 
-            if (detect(pc.SEE_BIT, obj_ptr->OBJ_VIS_BIT)) {
+			 if (pc.canSee(*obj_ptr)){  //  detect(pc.SEE_BIT, obj_ptr->OBJ_VIS_BIT)) {
 
                id_num = obj_ptr->getIdNum();
 

Modified: trunk/mud/grrmud/server/misc2.cc
===================================================================
--- trunk/mud/grrmud/server/misc2.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/misc2.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -2257,3 +2257,49 @@
          ++i;
    }
 }
+
+void blow_out_lights(critter* pc, bool small){
+	room* rm = pc->getCurRoom();
+	int cval = 100;
+	if(small) cval = 500;
+	int p;
+
+	switch(weather.climates[rm->getClimate()].wind){
+		   case lightwind:
+			   p = 3;
+			   break;
+		   case windy:
+			   p = 4;
+			   break;
+		   case verywindy:
+			   p = 5;
+			   break;
+		   case gale:
+			   p = 10;
+			   break;
+		   default:	
+			   p = 0;
+	}
+	if(rand()%cval <= p){
+		if(pc->EQ[11] && pc->EQ[11]->isLightSource() && pc->eq[11]->obj_flags.get(6)){
+			pc->gainInv(pc->EQ[11]);
+			remove_eq_effects(*(pc->EQ[11]), *pc, FALSE, FALSE, 11);
+			pc->EQ[11] = NULL; 
+			pc->show("Your light has been blown out by the wind!\n");
+		}
+	}
+}
+
+void blow_out_lights(ClimateType i, bool small){
+   if(weather.climates[i].wind > lightwind){
+	   Cell<critter*> cll(pc_list);
+	   critter* pc;
+	   room* rm;
+	   while((pc = cll.next())){
+		   rm = pc->getCurRoom();
+		   if(rm->getClimate() == i){
+			   blow_out_lights(pc, small);
+		   }
+	   }
+   }
+}

Modified: trunk/mud/grrmud/server/misc2.h
===================================================================
--- trunk/mud/grrmud/server/misc2.h	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/misc2.h	2007-06-10 13:46:58 UTC (rev 936)
@@ -199,4 +199,7 @@
 
 void combine_weights(int* target, const float* in, unsigned int length);
 
+void blow_out_lights(ClimateType i, bool small);
+void blow_out_lights(critter* pc, bool small);
+
 #endif 

Modified: trunk/mud/grrmud/server/weather.cc
===================================================================
--- trunk/mud/grrmud/server/weather.cc	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/weather.cc	2007-06-10 13:46:58 UTC (rev 936)
@@ -35,15 +35,15 @@
 //TODO make wNONE, cNONE, tNONE valid array indexes
 
 //climate weather base				   C   Cl  O   D   Lr  Hr  T   h   H   Ls  S   B   SS
-const int temperate_weights[]     = { 200,100,100,100,100,100, 80, 80, 70, 50, 40, 30,  0};
-const int savanah_weights[]       = { 200,100, 80, 80, 80, 80, 80, 70, 70, 35, 30, 15,  0};
-const int mountain_weights[]      = { 200,100,100,100,100,100,100, 80, 80, 75, 65, 45,  0};
-const int snowymountain_weights[] = { 200,130,130, 60, 60, 50, 40, 20, 10,130,100, 70,  0};
-const int sandydesert_weights[]   = { 1000, 400, 200,  30,  20,  10,  10,  0,  0,  0,  0,  0,100};//big values to avoid fp convert dropping the small ones completely
-const int dirtdesert_weights[]    = { 1000, 400, 300,  30,  20,  10,  10,  0,  0,  0,  0,  0,  0};
-const int swamp_weights[]         = { 150,150,150,110,110,110,110, 90, 90, 40, 20, 10,  0};
-const int tropical_weights[]      = { 200,100,100,100,100,100,100, 70, 60,  0,  0,  0,  0};
-const int arctic_weights[]        = { 200,100,100, 10,  5,  5,  1,  0,  0,140,130,100,000};
+const int temperate_weights[]     = { 175,100,100,100,100,100, 80, 80, 70, 50, 40, 30,  0};
+const int savanah_weights[]       = { 175,100, 80, 80, 80, 80, 80, 70, 70, 35, 30, 15,  0};
+const int mountain_weights[]      = { 175,100,100,100,100,100,100, 80, 80, 75, 65, 45,  0};
+const int snowymountain_weights[] = { 140,130,130, 60, 60, 50, 40, 20, 10,130,100, 70,  0};
+const int sandydesert_weights[]   = { 500, 400, 200,  30,  20,  10,  10,  0,  0,  0,  0,  0,250};//big values to avoid fp convert dropping the small ones completely
+const int dirtdesert_weights[]    = { 500, 400, 300,  30,  20,  10,  10,  0,  0,  0,  0,  0,  0};
+const int swamp_weights[]         = { 140,150,150,110,110,110,110, 90, 90, 40, 20, 10,  0};
+const int tropical_weights[]      = { 175,100,100,100,100,100,100, 70, 60,  0,  0,  0,  0};
+const int arctic_weights[]        = { 175,100,100, 10,  5,  5,  1,  0,  0,140,130,100,000};
 /* original weights for referance
 const int temperate_weights[] = { 520,130,130,65,55,48,32,20,10,65,48,32,0};
 const int savanah_weights[] = { 520,100,90,32,28,24,16,10,5,5,0,0,0};
@@ -59,28 +59,27 @@
 const float clear_weights[]        = { 3.00,0.80,0.60,0.30,0.20,0.20,0.10,0.20,0.10,0.20,0.10,0.10,1.00};
 const float cloudy_weights[]       = { 0.80,3.00,0.80,0.60,0.50,0.50,0.40,0.50,0.40,0.50,0.50,0.25,1.00};
 const float overcast_weights[]     = { 0.75,2.00,3.00,2.00,0.75,0.50,0.40,0.50,0.50,2.00,0.50,0.25,1.00};
-const float drizzle_weights[]      = { 1.00,1.50,2.50,4.00,2.50,1.50,1.15,1.15,1.15,1.00,1.00,1.00,0.00};
-const float rain_weights[]         = { 0.80,1.25,1.50,2.00,3.00,2.00,1.30,1.25,1.20,0.50,0.50,0.50,0.00};
-const float heavyrain_weights[]    = { 0.60,1.00,1.50,1.50,2.00,4.00,1.60,1.00,1.00,0.30,0.30,0.30,0.00};
-const float thunderstorm_weights[] = { 0.40,0.80,1.250,1.25,1.50,2.00,4.00,1.50,1.35,0.20,0.20,0.20,0.00};
-const float hail_weights[]         = { 0.50,0.60,0.70,1.50,1.00,1.00,1.50,3.00,1.40,0.20,0.20,0.20,0.00};
-const float hailstorm_weights[]    = { 0.30,0.40,1.50,1.75,2.25,2.25,1.50,1.50,3.35,0.35,0.35,0.35,0.00};
+const float drizzle_weights[]      = { 1.00,1.50,2.50,4.00,2.50,1.50,1.15,1.15,1.15,1.00,1.00,1.00,1.00};
+const float rain_weights[]         = { 0.80,1.25,1.50,2.00,3.00,2.00,1.30,1.25,1.20,0.50,0.50,0.50,1.00};
+const float heavyrain_weights[]    = { 0.60,1.00,1.50,1.50,2.00,4.00,1.60,1.00,1.00,0.30,0.30,0.30,1.00};
+const float thunderstorm_weights[] = { 0.40,0.80,1.25,1.25,1.50,2.00,4.00,1.50,1.35,0.20,0.20,0.20,1.00};
+const float hail_weights[]         = { 0.50,0.60,0.70,1.50,1.00,1.00,1.50,3.00,1.40,0.20,0.20,0.20,1.00};
+const float hailstorm_weights[]    = { 0.30,0.40,1.50,1.75,2.25,2.25,1.50,1.50,3.35,0.35,0.35,0.35,1.00};
 const float lightsnow_weights[]    = { 0.60,1.40,2.00,0.50,0.50,0.50,0.40,0.00,0.00,3.00,2.00,1.25,0.00};
 const float heavysnow_weights[]    = { 0.30,1.40,1.60,0.40,0.40,0.40,0.40,0.00,0.00,2.00,3.00,1.50,0.00};
 const float blizzard_weights[]     = { 0.20,1.30,1.50,0.25,0.25,0.25,0.25,0.00,0.00,1.75,2.25,2.50,0.00};
-const float sandstorm_weights[]    = { 0.50,1.00,1.00,1.00,1.00,1.00,1.00,0.00,0.00,0.00,0.00,0.00,10.00};
+const float sandstorm_weights[]    = { 0.50,0.50,0.50,1.00,1.00,1.00,1.00,0.00,0.00,0.00,0.00,0.00,7.5};
 const float* weather_weights[]= { clear_weights, cloudy_weights,
    overcast_weights,drizzle_weights,rain_weights,heavyrain_weights,
    thunderstorm_weights,hail_weights,hailstorm_weights,lightsnow_weights,
    heavysnow_weights,blizzard_weights,sandstorm_weights};
 
 //weather season weights
-const float spring_weights[]       = { 1.00,1.20,1.20,1.20,1.20,1.20,1.20,1.10,1.10,0.75,0.75,0.10,1.00};
-const float summer_weights[]       = { 1.10,1.10,1.10,1.20,1.10,1.10,1.30,1.10,1.10,0.50,0.50,0.50,1.00};
-const float fall_weights[]         = { 1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,0.60,0.60,0.60,1.00};
-const float winter_weights[]       = { 1.30,1.00,1.00,0.65,0.65,0.65,0.65,0.30,0.30,2.00,2.00,2.00,1.00};
-const float* season_weights[]      = { spring_weights,summer_weights, fall_weights,
-      winter_weights};
+const float spring_weights[]       = { 1.00,1.15,1.15,1.20,1.15,1.15,1.15,1.10,1.10,0.75,0.75,0.10,1.00};
+const float summer_weights[]       = { 1.10,1.10,1.10,1.10,1.10,1.10,1.30,1.10,1.10,0.50,0.50,0.50,1.00};
+const float fall_weights[]         = { 1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,1.00,0.70,0.70,0.70,1.00};
+const float winter_weights[]       = { 1.00,1.00,1.00,0.50,0.50,0.50,0.50,0.30,0.30,2.00,2.00,2.00,1.00};
+const float* season_weights[]      = { spring_weights, summer_weights, fall_weights, winter_weights};
 
 //climate temperature weights              F   V   C   Ch  P   W   H   Vh  B
 const int temperate_temp_weights[]     = { 10, 30, 40,100,100,100, 40, 30,  0};
@@ -136,9 +135,9 @@
 // weights for nighttime
 const float night_temp_weights[] = { 1.5,1.5,1.5,1.5,1.0,1.0,1.0,1.0,1.0 };
 
-//wind range
-const int wind_min[] = {0,0,0,0,5,16,0,16,0,5,12,16,30};
-const int wind_max[] = {30,30,30,30,30,35,65,30,65,30,35,65,70};
+//wind range            
+const int wind_min[] = {0,0,0,0,5,5,10,15,15,5,5,45,50};
+const int wind_max[] = {35,35,35,35,35,35,65,35,60,35,35,65,70};
 
 //name strings
 const char* climate_strings[] = {"temperate","savanah","mountain",
@@ -232,9 +231,9 @@
 	heavysnow_change_strings, blizzard_change_strings, sandstorm_change_strings };
 
 
-//regen and mv usage mods
-const float weather_regen_mods[] = {1,1,1,1,0.95,0.9,0.8,0.9,0.8,0.95,0.9,0.8};
-const float temperature_regen_mods[] = {0.6,0.75,0.9,0.95,1,0.95,0.9,0.7,0.6};
+//regen and mv usage mods                C    Cl    O   D    Lr   Hr   T     h   H    ls   S    B
+const float weather_regen_mods[]     = {1.00,1.00,1.00,1.00,0.95,0.90,0.85,0.85,0.80,0.90,0.80,0.75,0.75};
+const float temperature_regen_mods[] = {0.75,0.85,0.90,1.00,1.00,1.00,0.90,0.85,0.75};
 const float weather_mv_mods[] = {1,1,1,1,1.1,1.25,1.5,1.25,1.5,1.1,1.25,1.25};
 const float temperature_mv_mods[] = {1.4,1.25,1.25,1.1,1.05,1,1.05,1.1,1.3,1.4};
 
@@ -365,42 +364,6 @@
    return w;
 }
 
-TemperatureType int_to_temp_enum(unsigned int i){
-	TemperatureType t;
-	switch(i){
-		case 0:
-			t = freezing;
-			break;
-		case 1:
-			t = verycold;
-			break;
-		case 2:
-			t = cold;
-			break;
-		case 3:
-			t = chilly;
-			break;
-		case 4:
-			t = pleasant;
-			break;
-		case 5:
-			t = warm;
-			break;
-		case 6:
-			t = hot;
-			break;
-		case 7:
-			t = veryhot;
-			break;
-		case 8:
-			t = burninghot;
-			break;
-		default:
-			t = tNONE;
-	}
-	return t;
-}
-
 Weather::Weather(){
    for(int i=0;i<MAX_CLIMATES;i++) {
       climates[i].weather = clear;
@@ -496,7 +459,7 @@
    DistProbMatrix<WeatherType> weather_prob;
    DistProbMatrix<TemperatureType> temp_prob;
    int tweights[MAX_TEMP];
-   TemperatureType old_temp = climates[i].temperature;
+   //TemperatureType old_temp = climates[i].temperature;
    WeatherType old_weather = climates[i].weather;
    //grab base weights for weather and temp
    memcpy(weights,climates[i].weather_base,MAX_WEATHER*sizeof(int)); 
@@ -516,9 +479,7 @@
 	  climates[i].weather = weather_prob.get();
    }else climates[i].weather = tw;
    //we have our new weather, so we can combine base, weather, season and temp weights
-   //do{ 
 
-gen_temperature:
    if(i == dirtdesert || i == sandydesert){
 	   if(config.hour < 6 || config.hour <=18){
 		   if(config.hour == 18) climates[i].temperature = chilly;
@@ -546,6 +507,8 @@
    case blizzard:
 	   if(climates[i].temperature > cold) climates[i].temperature = cold;
 	   break;
+   default:
+	   break;
    }
 
    combine_weights(tweights,weather_temp_weights[climates[i].weather],MAX_TEMP);
@@ -558,21 +521,8 @@
 	   if(tweights[idx] != 0) temp_prob.add(int_to_temperature_enum(idx),tweights[idx]);
 	   ++idx;
    }
-  // } while(temp_prob.Size() == 0 && ((old_temp = int_to_temp_enum(old_temp + 1)) != burninghot  ));
-   
-	   //FIX ME there has to be a better way to make sure temperatures are valid, this can fall into an infite loop
-  /* if( temp_prob.Size() == 0) {
-	   if(climates[i].weather >lightsnow){
-		   old_temp = int_to_temp_enum(old_temp - 1);
-		   goto gen_temperature;
-	   }
-	   else {
-		   old_temp = int_to_temp_enum(old_temp + 1);
-		   goto gen_temperature;
-	   }
-   }*/
-   climates[i].temperature = temp_prob.get();
 
+   climates[i].temperature = temp_prob.get();
     //get our wind values
    climates[i].windamount = 1+wind_min[i] + 
       (rand()%(wind_max[i]-wind_min[i]));
@@ -592,39 +542,7 @@
 	   }
    }
 
-   // let's blow out some lights
- /*  if(climates[i].wind > lightwind){
-	   Cell<critter*> cll(pc_list);
-	   critter* pc;
-	   room* rm;
-	   unsigned int p;
-	   while((pc = cll.next())){
-		   rm = pc->getCurRoom();
-		   if(rm->getClimate() == i){
-			   switch(climates[i].wind){
-				   case lightwind:
-						p = 5;
-						break;
-				   case windy:
-					   p = 8;
-					   break;
-				   case verywindy:
-					    p = 10;
-						break;
-				   case gale:
-					   p 14;
-					   break;
-						p = 0;
-			   }
-			   if(rand()%100 >= p){
-					//gave up trying to add a is_lit flag, jsut going to remove it from eq and drop it into inv
-
-			   }
-		   }
-	   }*/
-		
-
-
+   blow_out_lights(i, false);
 	   //if it's hailing, let's smack some people
    if(climates[i].weather == hail || climates[i].weather == hailstorm){
       Cell<critter*> cll(pc_list);

Modified: trunk/mud/grrmud/server/weather.h
===================================================================
--- trunk/mud/grrmud/server/weather.h	2007-06-10 09:58:51 UTC (rev 935)
+++ trunk/mud/grrmud/server/weather.h	2007-06-10 13:46:58 UTC (rev 936)
@@ -22,7 +22,6 @@
 
 #ifndef __WEATHER_INCLUDE
 #define __WEATHER_INCLUDE
-
 //we don't actually use most of these defines
 //climate types
 #define CTEMPERATE      0




More information about the ScryMUD mailing list