From: <wel...@us...> - 2011-02-26 11:51:39
|
Revision: 6992 http://planeshift.svn.sourceforge.net/planeshift/?rev=6992&view=rev Author: weltall2 Date: 2011-02-26 11:51:33 +0000 (Sat, 26 Feb 2011) Log Message: ----------- assign prerequisites only if they are valid (not null) Modified Paths: -------------- trunk/src/server/bulkobjects/psitemstats.cpp Modified: trunk/src/server/bulkobjects/psitemstats.cpp =================================================================== --- trunk/src/server/bulkobjects/psitemstats.cpp 2011-02-25 20:53:35 UTC (rev 6991) +++ trunk/src/server/bulkobjects/psitemstats.cpp 2011-02-26 11:51:33 UTC (rev 6992) @@ -593,12 +593,22 @@ } SetCategory(category); - reqs[0].name = row["requirement_1_name"]; - reqs[0].min_value = row.GetFloat("requirement_1_value"); - reqs[1].name = row["requirement_2_name"]; - reqs[1].min_value = row.GetFloat("requirement_2_value"); - reqs[2].name = row["requirement_3_name"]; - reqs[2].min_value = row.GetFloat("requirement_3_value"); + //set only if there is a valid value + if(row["requirement_1_name"]) + { + reqs[0].name = row["requirement_1_name"]; + reqs[0].min_value = row.GetFloat("requirement_1_value"); + } + if(row["requirement_2_name"]) + { + reqs[1].name = row["requirement_2_name"]; + reqs[1].min_value = row.GetFloat("requirement_2_value"); + } + if(row["requirement_1_name"]) + { + reqs[2].name = row["requirement_3_name"]; + reqs[2].min_value = row.GetFloat("requirement_3_value"); + } psString strTmpAmmoList = row["item_type_id_ammo"]; csStringArray strTmpAmmoListArray; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |