Jump to content
MakeWebGames

Explore module: Undefined variable: v


Someone
 Share

Recommended Posts

Error: Undefined variable: v

HINT: You should always declare your variables before using them. However this error could be triggered as well if you made a typo in the variable name or you missed to call the global $var_name command.

Error in evaluated code:

ResultMessage (Translate("You found %d !Currency !",$v),false);

Error in "F:/xampp/htdocs/nwe/libs/common.php(1140) : eval()'d code"

Line 1

Error in F:\xampp\htdocs\nwe\libs\common.php

Line 1140

Error in F:\xampp\htdocs\nwe\modules\explore\content.php

Line 108

Error in F:\xampp\htdocs\nwe\libs\common.php

Line 554

Error in F:\xampp\htdocs\nwe\index.php

Line 316

Please help us to improve the game by providing as much information regards any bugs.

----############################

Error: Undefined variable: v

HINT: You should always declare your variables before using them. However this error could be triggered as well if you made a typo in the variable name or you missed to call the global $var_name command.

Error in evaluated code:

ResultMessage (Translate("You found %d !Currency !",$v),false);

Error in "F:/xampp/htdocs/nwe/libs/common.php(1140) : eval()'d code"

Line 1

Error in F:\xampp\htdocs\nwe\libs\common.php

Line 1140

Error in F:\xampp\htdocs\nwe\modules\explore\content.php

Line 108

Error in F:\xampp\htdocs\nwe\libs\common.php

Line 554

Error in F:\xampp\htdocs\nwe\index.php

Line 316

Please help us to improve the game by providing as much information regards any bugs.

-----###################################

 

1st time

I went to explore in the welcome page, went to a bath, clicked choose another path (path 2), and clicked on the big rock on the map.

2nd time I did the same, digging on the map worked 3 times, beofre the error came up.

I have not modified the explore module in any way

Link to comment
Share on other sites

LOL for sure I meant bath :)

Any hows, I'll dig into it a bit and try to see what causes this. It has happened a few more times. The path type seems to have nothing to do with it anyways.

 

EDIT:

This is the explorations table record, causing the problem

id: 7

type id: 2

description: Translate("You found %d !Currency !",$v)

code: $v=rand(2,10)*1;/*rnd*/$userStats["!Currency"]->value+=$v;

EDIT 2

The bug is also present in the demo of the game

Also noticed an error in the bottom of pages in the engine demo

Fatal error: Call to undefined function error_get_last() in /www/new_worlds/demo/libs/common.php on line 1147

Edited by Someone
Link to comment
Share on other sites

LOL for sure I meant bath :)

Any hows, I'll dig into it a bit and try to see what causes this. It has happened a few more times. The path type seems to have nothing to do with it anyways.

EDIT:

This is the explorations table record, causing the problem

id: 7

type id: 2

description: Translate("You found %d !Currency !",$v)

code: $v=rand(2,10)*1;/*rnd*/$userStats["!Currency"]->value+=$v;

EDIT 2

The bug is also present in the demo of the game

Also noticed an error in the bottom of pages in the engine demo

Fatal error: Call to undefined function error_get_last() in /www/new_worlds/demo/libs/common.php on line 1147

Until a better way is implemented (I imagine A_Bertrand is on holiday now, so I'm guessing January is when he'll be back)

In libs/common.php.

Line: 1137

Replace

global $evalCode, $userStats, $modules, $allModules, $db, $content;

with

global $evalCode, $userStats, $modules, $allModules, $db, $content, $v;

EDIT: - Scratch that.

Probably a more appropriate way would be to do the following.

modules/explore/content.php

Lines:100 to 109

Replace:

/**
                * Evaluate the code to run.
                */
               if ($result->fields[1] != "")
                   NWEval($result->fields[1]);
               /**
                * Evaluate the message to give back.
                */
               NWEval("ResultMessage (" . $result->fields[0] . ",false);");
               $result->Close();

With:

                /**
                * Evaluate the code to run.
                */

               $eval = '';
               if ($result->fields[1] != "")
                   $eval .= $result->fields[1];

               /**
                * Evaluate the message to give back.
                */

               $eval .= 'ResultMessage ('.$result->fields[0].', false);';
               NWEval($eval);

               $result->Close();
Edited by Djkanna
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...