aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-10-12 13:13:08 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-10-12 13:13:08 +0000
commit0d3eac8c5e5026a9b41106dc73bc025fc5532899 (patch)
tree565bd62ee15bf51e1411e3de2e1fb7793e802d7a /code
parent04ea0138a7366d52074c11e69dbd9e26a9398ce4 (diff)
downloadioquake3-aero-0d3eac8c5e5026a9b41106dc73bc025fc5532899.tar.gz
ioquake3-aero-0d3eac8c5e5026a9b41106dc73bc025fc5532899.zip
Revert partially incorrect fix and add a few more float casts.
git-svn-id: svn://svn.icculus.org/quake3/trunk@933 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/botlib/be_ai_weight.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/code/botlib/be_ai_weight.c b/code/botlib/be_ai_weight.c
index ef5080d..b5329db 100644
--- a/code/botlib/be_ai_weight.c
+++ b/code/botlib/be_ai_weight.c
@@ -595,7 +595,7 @@ float FuzzyWeight_r(int *inventory, fuzzyseperator_t *fs)
//the scale factor
scale = (float) (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
//scale between the two weights
- return (1 - scale) * w1 + scale * w2;;
+ return scale * w1 + (1 - scale) * w2;
} //end if
return FuzzyWeight_r(inventory, fs->next);
} //end else if
@@ -627,7 +627,7 @@ float FuzzyWeightUndecided_r(int *inventory, fuzzyseperator_t *fs)
if (fs->next->child) w2 = FuzzyWeight_r(inventory, fs->next->child);
else w2 = fs->next->minweight + random() * (fs->next->maxweight - fs->next->minweight);
//the scale factor
- scale = (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
+ scale = (float) (inventory[fs->index] - fs->value) / (fs->next->value - fs->value);
//scale between the two weights
return scale * w1 + (1 - scale) * w2;
} //end if
@@ -750,7 +750,7 @@ void ScaleFuzzySeperator_r(fuzzyseperator_t *fs, float scale)
else if (fs->type == WT_BALANCE)
{
//
- fs->weight = (fs->maxweight + fs->minweight) * scale;
+ fs->weight = (float) (fs->maxweight + fs->minweight) * scale;
//get the weight between bounds
if (fs->weight < fs->minweight) fs->weight = fs->minweight;
else if (fs->weight > fs->maxweight) fs->weight = fs->maxweight;