EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Bug Reports (https://www.eqemulator.org/forums/forumdisplay.php?f=591)
-   -   shareddb.cpp (https://www.eqemulator.org/forums/showthread.php?t=21704)

LostZaphod 10-14-2006 07:45 AM

shareddb.cpp
 
I kept receiving the error message
shareddb.cpp
line 251
Run-Time Check Failure #3 - The variable 'augslot' is being used without being defined.

At the top it is defined as
uint32 augslot[5] = { 0, 0, 0, 0, 0 };
and on line 251
uint32 len_query = MakeAnyLenString(&query, "REPLACE INTO inventory (charid,slotid,itemid,charges,instnodrop,color,aug slot1,augslot2,augslot3,augslot4,augslot5) VALUES(%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i)",
char_id, slot_id, inst->GetItem()->ID, charges, inst->IsInstNoDrop() ? 1:0,inst->GetColor(),augslot[0],augslot[1],augslot[2],augslot[3],augslot[4],augslot[5] );

you find the augslot[5] (that is the sixth item of the array, and only five are defined). There are also 11 %i, but 12 variables are being passed. We need to remove the ",augslot[5]" from the line.
Code:

cvs diff -u -- shareddb.cpp (in directory C:\cvs\EQEmuCVS\Source\common\)
Index: shareddb.cpp
===================================================================
RCS file: /cvsroot/eqemulator/EQEmuCVS/Source/common/Attic/shareddb.cpp,v
retrieving revision 1.1.2.8
diff -u -r1.1.2.8 shareddb.cpp
--- shareddb.cpp        22 May 2006 04:03:49 -0000        1.1.2.8
+++ shareddb.cpp        14 Oct 2006 19:33:13 -0000
@@ -248,7 +248,9 @@
                                charges = 255;
                        // Update/Insert item
                        uint32 len_query = MakeAnyLenString(&query, "REPLACE INTO inventory (charid,slotid,itemid,charges,instnodrop,color,augslot1,augslot2,augslot3,augslot4,augslot5) VALUES(%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i)",
-                                char_id, slot_id, inst->GetItem()->ID, charges, inst->IsInstNoDrop() ? 1:0,inst->GetColor(),augslot[0],augslot[1],augslot[2],augslot[3],augslot[4],augslot[5] );
+                                char_id, slot_id, inst->GetItem()->ID, charges, inst->IsInstNoDrop() ? 1:0,inst->GetColor(),augslot[0],augslot[1],augslot[2],augslot[3],augslot[4] );
+                        //uint32 len_query = MakeAnyLenString(&query, "REPLACE INTO inventory (charid,slotid,itemid,charges,instnodrop,color,augslot1,augslot2,augslot3,augslot4,augslot5) VALUES(%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i)",
+                        //char_id, slot_id, inst->GetItem()->ID, charges, inst->IsInstNoDrop() ? 1:0,inst->GetColor(),augslot[0],augslot[1],augslot[2],augslot[3],augslot[4],augslot[5] );
                       
                        ret = RunQuery(query, len_query, errbuf);
                }

***** CVS exited normally with code 1 *****



All times are GMT -4. The time now is 10:28 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.