// *************************************************************** // Function: LoadSDItems.cpp // *************************************************************** #include "Main.h" //************************************ // Name: LoadSDItems // // Loads item definitions from the database. Needed for character creation. // // Parameters: // // Return: // true - no errors // false - Unable to load items //************************************ bool LoadSDItems() { //------------------------------------------------------------------ //Execute a query to clear ALL temporary items from the database //------------------------------------------------------------------ gCoreLog.WriteCategory("[Cleaning]"); gCoreLog.Section("Temporary Items..."); char query[100]; sprintf(query, "DELETE FROM items WHERE OwnerCID=1@NOSTATUS"); gDatabase.Query(query, (long)strlen(query)); gCoreLog.SectionOk(); //--------------------------------------------------------- //Load the items from the database //--------------------------------------------------------- gCoreLog.WriteCategory("[Loading]"); gCoreLog.Section("Item Definitions..."); if (gData.itemDefMan.Load()!=0) { gCoreLog.SectionFail(); gCoreLog.LOCATION; gCoreLog.error("Operation error. Cannot continue without items!"); return false; } else { gCoreLog.SectionOk(); } return true; }