Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
16 lines (12 sloc)
447 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import server | |
from atlas import Operation | |
class Immobile(server.Thing): | |
""" | |
Applied on entities that can't be moved | |
""" | |
def move_operation(self, op): | |
# Is the move operation sent because the parent has been deleted? If so we should delete ourselves. | |
if self.parent.is_destroyed: | |
return server.OPERATION_BLOCKED, Operation("delete", to=self) | |
else: | |
return server.OPERATION_BLOCKED |