jorrit
Sat, 11 Feb 2012 08:19:51 -0800
Revision: 4727
http://cel.svn.sourceforge.net/cel/?rev=4727&view=rev
Author: jorrit
Date: 2012-02-11 16:19:41 +0000 (Sat, 11 Feb 2012)
Log Message:
-----------
Fixed a bug in the change property reward. The test for the existance
of a default parameter was wrong.
Modified Paths:
--------------
cel/trunk/plugins/tools/rewards/reward_changeproperty.cpp
Modified: cel/trunk/plugins/tools/rewards/reward_changeproperty.cpp
===================================================================
--- cel/trunk/plugins/tools/rewards/reward_changeproperty.cpp 2012-02-11
14:57:18 UTC (rev 4726)
+++ cel/trunk/plugins/tools/rewards/reward_changeproperty.cpp 2012-02-11
16:19:41 UTC (rev 4727)
@@ -205,19 +205,20 @@
(type->object_reg, "cel.parameters.manager");
prop = pm->GetParameter (params, prop_par);
- if (pc_par) pc = pm->GetParameter (params, pc_par);
- if (tag_par) tag = pm->GetParameter (params, tag_par);
- if (string_par) pstring = pm->GetParameter (params, string_par);
- if (long_par) plong = pm->GetParameter (params, long_par);
- if (float_par) pfloat = pm->GetParameter (params, float_par);
- if (bool_par) pbool = pm->GetParameter (params, bool_par);
- if (diff_par) pdiff = pm->GetParameter (params, diff_par);
+ if (pc_par && *pc_par) pc = pm->GetParameter (params, pc_par);
+ if (tag_par && *tag_par) tag = pm->GetParameter (params, tag_par);
+ if (string_par && *string_par) pstring = pm->GetParameter (params,
string_par);
+ if (long_par && *long_par) plong = pm->GetParameter (params, long_par);
+ if (float_par && *float_par) pfloat = pm->GetParameter (params, float_par);
+ if (bool_par && *bool_par) pbool = pm->GetParameter (params, bool_par);
+ if (diff_par && *diff_par) pdiff = pm->GetParameter (params, diff_par);
celChangePropertyRewardBase::do_toggle = do_toggle;
}
void celChangePropertyRewardBase::ChangePropertyOnPc (iCelPropertyClass
*pclass,
iCelParameterBlock* params)
{
+ printf ("ChangePropertyOnPc\n"); fflush (stdout);
const char* p = prop->Get (params);
if (!p) return;
iCelPlLayer* pl = type->pl;
@@ -316,6 +317,7 @@
void celChangePropertyRewardBase::ChangePropertyOnPcProp (iPcProperties
*properties,
iCelParameterBlock* params)
{
+ printf ("ChangePropertyOnProp\n"); fflush (stdout);
const char* p = prop->Get (params);
if (!p) return;
// Do NOT use IsEmpty() here! Empty string is valid data.
@@ -449,15 +451,23 @@
ent = pm->ResolveEntityParameter (pl, params, entity, ent);
if (!ent) return;
- // Generic Property class style
+ const char* p = 0;
+ bool changed;
if (pc)
{
- bool changed;
- const char* p = pc->Get (params, changed);
+ p = pc->Get (params, changed);
if (changed) pclass = 0;
+ if (p && *p == 0) p = 0;
+ }
+ // Generic Property class style
+ if (p)
+ {
const char* t = 0;
if (tag)
- t = tag->Get (params, changed);
+ {
+ t = tag->Get (params, changed);
+ if (t && *t == 0) t = 0;
+ }
if (changed) pclass = 0;
if (!pclass)
{
@@ -517,12 +527,13 @@
if (!p) return;
if (tag)
{
- const char* t = tag->Get (params);
- pclass = ent->GetPropertyClassList ()->FindByNameAndTag (p, t);
+ const char* t = tag->Get (params);
+ if (t && *t == 0) t = 0;
+ pclass = ent->GetPropertyClassList ()->FindByNameAndTag (p, t);
}
else
{
- pclass = ent->GetPropertyClassList ()->FindByName (p);
+ pclass = ent->GetPropertyClassList ()->FindByName (p);
}
if (pclass)
ChangePropertyOnPc (pclass, params);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Cel-cvs-update mailing list
Cel-cvs-update@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cel-cvs-update