Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9221663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:37:30+00:00 2026-06-18T03:37:30+00:00

I have an really estrange error. I got an object attribute of int type

  • 0

I have an really estrange error. I got an object attribute of int type called currentState

here is the declaration

class WorkerAgent : public BaseAgent {

private:
    int currentState;

The code below runs a lot of times inside a loop of a game but SOMETIMES (in a random time) the code chashes the program at the line (270)

*OBS: currentState is initialized already when running this line of code (270)!

if (currentState == REPAIRING) {

    if (!unit->isRepairing()) {

        setState(GATHER_MINERALS);
        BaseAgent* base = AgentManager::getInstance()->getClosestBase(unit->getTilePosition());

        if (base != NULL) {

            unit->rightClick(base->getUnit());
            return;
        }
    } else {

        return;
    }
}

int cur = currentState; // (line 270) 
bool b = cur == FIND_BUILDSPOT; 

I have an EXCEPTION_ACCESS_VIOLATION and the program chashes.. I dont know can be happening since currentState is not a pointer neither cur

Error

VERSION: 1.16.1.1
BWAPI:
  REVISION: 4160
  BUILD: RELEASE
  ERROR: None
  LOCATION: Single Player 
MAP: Stepping Stones
     (3)Stepping Stones.scm

EXCEPTION: 0xC0000005    EXCEPTION_ACCESS_VIOLATION
FAULT:     0x10044217    BWAPI.dll
REGISTERS:
  EDI: 00000140
  ESI: 00000003
  EBX: 00000000
  EDX: C208C483
  ECX: 5B46A60C
  EAX: 035F0001
  EBP: 0018EEE8
  EIP: 10044217
  ESP: 0018E4C4
STACK:
  BWAPI.dll         0x10044217      ----
  BWAPI.dll         0x10046C38      ----
  BWAPI.dll         0x10047A43      ----
  BWAPI.dll         0x100408C6      ----
  DUMB.DLL          0x5B4254A0    WorkerAgent::computeActions
    d:\programming\mestrado\bots\dumb\bthaimodule\source\workeragent.cpp:270

Any other information about the case, please ask me! I’am getting crazy with this problem!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:37:32+00:00Added an answer on June 18, 2026 at 3:37 am

    currentState is a member of your class WorkerAgent, which means you have to have a valid object of type WorkerAgent for currentState to exist.

    You’re probably using an invalid (null, uninitalized, deleted, or otherwise garbage) pointer to a WorkerAgent in code you haven’t shown us.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a program where a lot of classes have really complicated configuration requirements.
I have really put efforts in searching for possible answers here and on Google.
We have really strange and inconsistent behavior with Linq-to-SQL here. Our application is installed
ive got a really weird problem. i have no clue why its not working.
i am making an object-oriented app in coldfusion, and so i have really broken
When saving my core data context I have the following error. I have really
I have this SphereInFrustrum function here: 0.49% int FrustumG::sphereInFrustum(Vec3 &p, float radius) { int
I have got an older database for which (at some really questionable and obscure
I have really simple XML (HTML) parsing ANTLR grammar: wiki: ggg+; ggg: tag |
I have really basic question. How can I get form id by input element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.