962 |
ShogunDot::stone_change(Stone *st) |
ShogunDot::stone_change(Stone *st) |
963 |
{ |
{ |
964 |
if (activated) { |
if (activated) { |
965 |
assert(st != 0); // if fails : ShogunStone disappeared w/o sending proper message to ShogunDot |
if (st == 0) { |
966 |
|
fprintf(stderr, "ShogunDot::stone_change: Stone disappeared w/o sending me a proper message!\n"); |
967 |
|
} |
968 |
|
// assert(st != 0); // if fails : ShogunStone disappeared w/o sending proper message to ShogunDot |
969 |
} |
} |
970 |
else { |
else { |
971 |
if (st) { // some Stone on inactive ShogunDot |
if (st) { // some Stone on inactive ShogunDot |
|
SendMessage(st, "renotify"); // ask stone to notify me (again) |
|
|
|
|
972 |
// if ShogunDot was set _after_ ShogunStone during level startup, |
// if ShogunDot was set _after_ ShogunStone during level startup, |
973 |
// the ShogunDot does not get activated. |
// the ShogunDot does not get activated. |
974 |
|
SendMessage(st, "renotify"); // ask stone to notify me (again) |
975 |
} |
} |
976 |
} |
} |
977 |
} |
} |
1263 |
play_sound("puller"); |
play_sound("puller"); |
1264 |
} |
} |
1265 |
void animcb() { |
void animcb() { |
1266 |
Direction dir = get_orientation(); |
Direction dir = get_orientation(); |
1267 |
GridPos stonepos = move(get_pos(), reverse(dir)); |
GridPos stonepos = move(get_pos(), reverse(dir)); |
1268 |
|
#if defined(USE_IMPULSES) |
1269 |
|
SendImpulse(stonepos, dir); |
1270 |
|
#else |
1271 |
world::MaybeMoveStone(stonepos, dir); |
world::MaybeMoveStone(stonepos, dir); |
1272 |
|
#endif // USE_IMPULSES |
1273 |
play_sound("explosion2"); |
play_sound("explosion2"); |
1274 |
SetItem(get_pos(), new Explosion(Explosion::WEAK)); |
SetItem(get_pos(), new Explosion(Explosion::WEAK)); |
1275 |
} |
} |