diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llgenepool.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llgenepool.cpp')
-rw-r--r-- | linden/indra/newview/llgenepool.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/linden/indra/newview/llgenepool.cpp b/linden/indra/newview/llgenepool.cpp index 9974aa8..553bcad 100644 --- a/linden/indra/newview/llgenepool.cpp +++ b/linden/indra/newview/llgenepool.cpp | |||
@@ -248,7 +248,7 @@ void LLGenePool::spawn( EWearableType type ) | |||
248 | do | 248 | do |
249 | { | 249 | { |
250 | i = rand() % mArchetypes.count(); | 250 | i = rand() % mArchetypes.count(); |
251 | cur_sex_weight = *(mArchetypes[i]->mParamMap[ male_param_id ]); | 251 | cur_sex_weight = mArchetypes[i]->getParam(male_param_id, 0.f); |
252 | cycles++; | 252 | cycles++; |
253 | if (cur_sex_weight != sex_weight) | 253 | if (cur_sex_weight != sex_weight) |
254 | { | 254 | { |
@@ -271,7 +271,7 @@ void LLGenePool::spawn( EWearableType type ) | |||
271 | do | 271 | do |
272 | { | 272 | { |
273 | j = rand() % mArchetypes.count(); | 273 | j = rand() % mArchetypes.count(); |
274 | cur_sex_weight = *(mArchetypes[j]->mParamMap[ male_param_id ]); | 274 | cur_sex_weight = mArchetypes[j]->getParam(male_param_id, 0.f); |
275 | 275 | ||
276 | cycles++; | 276 | cycles++; |
277 | } while( | 277 | } while( |
@@ -293,7 +293,7 @@ void LLGenePool::spawn( EWearableType type ) | |||
293 | do | 293 | do |
294 | { | 294 | { |
295 | k = rand() % mArchetypes.count(); | 295 | k = rand() % mArchetypes.count(); |
296 | cur_sex_weight = *(mArchetypes[k]->mParamMap[ male_param_id ]); | 296 | cur_sex_weight = mArchetypes[k]->getParam(male_param_id, 0.f); |
297 | cycles++; | 297 | cycles++; |
298 | } while( | 298 | } while( |
299 | (cycles < MAX_CYCLES) && | 299 | (cycles < MAX_CYCLES) && |
@@ -326,18 +326,13 @@ void LLGenePool::spawn( EWearableType type ) | |||
326 | if (param_id != male_param_id) | 326 | if (param_id != male_param_id) |
327 | { | 327 | { |
328 | 328 | ||
329 | F32* weight1p = arch1->getParam( param_id ); | 329 | F32 weight1 = arch1->getParam( param_id, param->getDefaultWeight() ); |
330 | F32 weight1 = weight1p ? *weight1p : param->getDefaultWeight(); | ||
331 | F32 net_weight = weight1; | 330 | F32 net_weight = weight1; |
332 | 331 | ||
333 | if( arch2 && arch3 ) | 332 | if( arch2 && arch3 ) |
334 | { | 333 | { |
335 | F32* weight2p = arch2->getParam( param_id ); | 334 | F32 weight2 = arch2->getParam( param_id, param->getDefaultWeight() ); |
336 | F32 weight2 = weight2p ? *weight2p : param->getDefaultWeight(); | 335 | F32 weight3 = arch3->getParam( param_id, param->getDefaultWeight() ); |
337 | |||
338 | F32* weight3p = arch3->getParam( param_id ); | ||
339 | F32 weight3 = weight3p ? *weight3p : param->getDefaultWeight(); | ||
340 | |||
341 | net_weight = b1 * weight1 + b2 * weight2 + b3 * weight3; | 336 | net_weight = b1 * weight1 + b2 * weight2 + b3 * weight3; |
342 | } | 337 | } |
343 | 338 | ||