mirror of
https://github.com/zhenyan121/SporeBG-Conid.git
synced 2026-04-09 22:06:09 +08:00
fix: delayed piece texture cleanup
This commit is contained in:
@@ -100,6 +100,7 @@ bool GameSession::executeAction(int toRow, int toCol) {
|
||||
if (!toPiece) {
|
||||
m_gamePieceEventCallback(GamePieceEvent::MOVE_PIECE, fromRow, fromCol, toRow, toCol);
|
||||
auto fromInfo = fromPiece->getPieceInfo();
|
||||
m_gamePieceEventCallback(GamePieceEvent::REMOVE_PIECE, fromRow, fromCol, -1, -1);
|
||||
m_board->removePieceAt(fromRow, fromCol);
|
||||
m_board->placePieceAt(toRow, toCol, m_currentPlayer);
|
||||
m_board->setPieceInfo(toRow, toCol, fromInfo);
|
||||
|
||||
@@ -30,7 +30,7 @@ enum class GameMode {
|
||||
};
|
||||
|
||||
enum class GamePieceEvent {
|
||||
REMOVE_PIECE,
|
||||
REMOVE_PIECE, // 用于销毁棋子的材质释放内存的
|
||||
PLACE_PIECE,
|
||||
MOVE_PIECE,
|
||||
GROW_PIECE,
|
||||
|
||||
Reference in New Issue
Block a user