fixed a few bugs
This commit is contained in:
parent
bb470ad518
commit
cad7cc19a2
@ -8,8 +8,10 @@ Dude::Dude(const Coord &_pos, Map *_map, const int &_team) :
|
|||||||
m_team(_team),
|
m_team(_team),
|
||||||
m_dead(false),
|
m_dead(false),
|
||||||
m_success(true),
|
m_success(true),
|
||||||
|
m_receivedComData(false),
|
||||||
m_inventory(EMPTY)
|
m_inventory(EMPTY)
|
||||||
{
|
{
|
||||||
|
memset(m_com_data.data, 0, COM_SIZE);
|
||||||
m_action.dir = NO_DIR;
|
m_action.dir = NO_DIR;
|
||||||
m_action.type = Action::WAIT;
|
m_action.type = Action::WAIT;
|
||||||
m_action.com_data = Com();
|
m_action.com_data = Com();
|
||||||
|
@ -220,7 +220,7 @@ void Simulation::handleAction(Dude *dude)
|
|||||||
Dude *targetDude = target.data.dudePtr;
|
Dude *targetDude = target.data.dudePtr;
|
||||||
// TODO check conflicts between writers
|
// TODO check conflicts between writers
|
||||||
if(targetDude->getCom() == nullptr){
|
if(targetDude->getCom() == nullptr){
|
||||||
targetDude->receiveComData(Dir((action.dir+2)%4), targetDude->getAction().com_data.data);
|
targetDude->receiveComData(Dir((action.dir+2)%4), dude->getAction().com_data.data);
|
||||||
dude->setSuccess(true);
|
dude->setSuccess(true);
|
||||||
}else
|
}else
|
||||||
dude->setSuccess(false);
|
dude->setSuccess(false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user