Jump to content

[fix]Little typo


Guest fabian

Recommended Posts

What bug does the patch fix? What features does the patch add?

I think it'S only a little typo :P

For which repository revision was the patch created?

10267

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

no

Who has been writing this patch? Please include either forum user names or email addresses.

me

diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 725c237..2c0c07a 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -1803,8 +1803,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)

            if (!Utf8FitTo (name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if (loc==GetSessionDbcLocale ())
                        continue;
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index b7c0374..804e7a6 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -923,8 +923,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if (loc == GetSessionDbcLocale())
                        continue;
@@ -4091,8 +4090,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)

        if (!Utf8FitTo(name, wnamepart))
        {
-            loc = 0;
-            for(; loc < MAX_LOCALE; ++loc)
+            for (loc = 0; loc < MAX_LOCALE; ++loc)
            {
                if (loc==GetSessionDbcLocale())
                    continue;
@@ -4429,8 +4427,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if (loc == GetSessionDbcLocale())
                        continue;
diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp
index 0eed067..7b85751 100644
--- a/src/game/Level3.cpp
+++ b/src/game/Level3.cpp
@@ -2721,8 +2721,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char* args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if(loc==GetSessionDbcLocale())
                        continue;
@@ -2784,8 +2783,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char* args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if(loc==GetSessionDbcLocale())
                        continue;
@@ -2909,8 +2907,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if(loc==GetSessionDbcLocale())
                        continue;
@@ -3197,8 +3194,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)

            if (!Utf8FitTo(name, wnamepart))
            {
-                loc = 0;
-                for(; loc < MAX_LOCALE; ++loc)
+                for (loc = 0; loc < MAX_LOCALE; ++loc)
                {
                    if(loc==GetSessionDbcLocale())
                        continue;

Link to comment
Share on other sites

yep, I also learned it this way:

for (loc = 0; loc < MAX_LOCALE; ++loc)

for(initvar; compare; increment)

Because loc is used after the loop, you could init it before compare it in the loop because you can better see that it will be not only used within the loop.

but for the compiler, it is the same.

so: wayne xD?

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use