This commit is contained in:
yvt 2014-03-13 14:01:53 +09:00
parent b1c87560c9
commit 8ebc1ffe15

View File

@ -1052,12 +1052,15 @@ namespace spades {
std::vector<IntVector3> cells; std::vector<IntVector3> cells;
if(action == 0){ if(action == 0){
bool replace = GetWorld()->GetMap()->IsSolidWrapped(pos.x, pos.y, pos.z);
if(!p){ if(!p){
GetWorld()->CreateBlock(pos, temporaryPlayerBlockColor); GetWorld()->CreateBlock(pos, temporaryPlayerBlockColor);
}else{ }else{
GetWorld()->CreateBlock(pos, p->GetBlockColor()); GetWorld()->CreateBlock(pos, p->GetBlockColor());
client->PlayerCreatedBlock(p); client->PlayerCreatedBlock(p);
p->UsedBlocks(1); if(!replace) {
p->UsedBlocks(1);
}
} }
}else if(action == 1){ }else if(action == 1){
cells.push_back(pos); cells.push_back(pos);