MCPcopy Create free account
hub / github.com/SimHacker/micropolis / SimCmdMonsterDirection

Function SimCmdMonsterDirection

micropolis-activity/src/sim/w_sim.c:865–887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

863
864
865int SimCmdMonsterDirection(ARGS)
866{
867 int dir;
868 SimSprite *sprite;
869
870 if (argc != 3) {
871 return (TCL_ERROR);
872 }
873
874 if ((Tcl_GetInt(interp, argv[2], &dir) != TCL_OK) ||
875 (dir < -1) || (dir > 7)) {
876 return (TCL_ERROR);
877 }
878 if ((sprite = GetSprite(GOD)) == NULL) {
879 MakeMonster();
880 if ((sprite = GetSprite(GOD)) == NULL) {
881 return (TCL_ERROR);
882 }
883 }
884 sprite->control = dir;
885
886 return (TCL_OK);
887}
888
889
890int SimCmdTile(ARGS)

Callers

nothing calls this directly

Calls 2

Tcl_GetIntFunction · 0.85
GetSpriteFunction · 0.85

Tested by

no test coverage detected