[CF-Devel] Patch: Win32 fixes

crossfire-devel at archives.real-time.com crossfire-devel at archives.real-time.com
Tue Apr 27 16:34:27 CDT 2004


Just a small patch for 1.6.0 release, I don't think it changes 
anything to Linux, but just to be on the safe side, i submit it here :)

Just need 3 explicit casts from 'float' to 'unsigned float', because 
messing uint64 & float isn't great apparently (error message). Since 
the 3 are in shops or money-related, and the value is a uint64, the 
cast seems harmless.

Nicolas 'Ryo'
-------------- next part --------------
Index: server/shop.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/shop.c,v
retrieving revision 1.28
diff -u -r1.28 shop.c
--- server/shop.c	25 Apr 2004 07:17:40 -0000	1.28
+++ server/shop.c	27 Apr 2004 21:33:13 -0000
@@ -189,9 +189,9 @@
 	 * reflect values (potion charisma list for 1250 gold)
 	 */
 	if(flag==F_BUY)
-          val=(4.0*(float)val*(1.0+diff));
+          val=((unsigned float)4.0*val*(unsigned float)(1.0+diff));
 	else if (flag==F_SELL)
-          val=(4.0*(float)val*(1.0-diff));
+          val=((unsigned float)4.0*val*(unsigned float)(1.0-diff));
 	else val *=4;
     }
 
Index: server/spell_effect.c
===================================================================
RCS file: /cvsroot/crossfire/crossfire/server/spell_effect.c,v
retrieving revision 1.117
diff -u -r1.117 spell_effect.c
--- server/spell_effect.c	25 Apr 2004 07:17:40 -0000	1.117
+++ server/spell_effect.c	27 Apr 2004 21:33:19 -0000
@@ -1648,7 +1648,7 @@
     else if (obj->type==MONEY || obj->type==GEM)
 	value /=3;
     else
-	value *= 0.9;
+	value *= ( unsigned float )0.9f;
 
     if ((obj->value>0) && rndm(0, 29)) {
 	int count;
-------------- next part --------------
_______________________________________________
crossfire-devel mailing list
     
     crossfire-devel at lists.real-time.com
     
     
     https://mailman.real-time.com/mailman/listinfo/crossfire-devel
     
     
    


More information about the crossfire mailing list