google-code-export / bwapi

Automatically exported from code.google.com/p/bwapi
0 stars 0 forks source link

Wrong data in AIModule::onSendText(std::string text) #172

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compile the ExampleAIModule in BWAPI2.4beta (VC++2008)
2. run it in MY machine (Windows XP sp3) with any map.
3. type in anything, the text would be all the same, wrong data.

What is the expected output? What do you see instead?
in short, the function argument text is not right. whatever I typed in the 
game, the text would be a three chars string: "lu_". The first one seems to 
be the same as ordinary 'l', the second one is u with a check above it, and 
the third one is a control char. Therefore:
Broodwar->printf("!%s!", text);
will give something like:
!lu                                             !(most right of the screen)

What version of the product are you using? On what operating system?
BWAPI 2.4 in Windows XP sp3

Please provide any additional information below.

Original issue reported on code.google.com by hero...@gmail.com on 22 Dec 2009 at 12:20

GoogleCodeExporter commented 9 years ago
Please try using BWAPI Beta 2.5. Also, the parameter for onSendText is an
std::string, not a character array, so to display it with printf or sendText 
you need
to convert it to a c string like so:

Broodwar->printf("%s", text.c_str());

Original comment by lowerlo...@gmail.com on 22 Dec 2009 at 3:24

GoogleCodeExporter commented 9 years ago
sorry for the confusion, but
Broodwar->printf("%s", text)
WAS the one I tried. However, I soon noticed the c_str() thing and used
Broodwar->printf("%s", text.c_str())
instead.
The phenomenon I described above is for the later case.

I will try BWAPI 2.5 soon and hopefully eliminate this bug.

Original comment by hero...@gmail.com on 22 Dec 2009 at 3:31

GoogleCodeExporter commented 9 years ago
Please post back and tell us if the bug was fixed or not.

Original comment by AHeinerm on 25 Dec 2009 at 4:01

GoogleCodeExporter commented 9 years ago
Unable to reproduce bug and no response from hero080 for over a week. I assume 
the
issue is invalid and/or has been fixed in BWAPI Beta 2.5.

Original comment by lowerlo...@gmail.com on 30 Dec 2009 at 10:36