Rename getDir to promptDirection; rotate TODO (step 5 done)

This commit is contained in:
2026-07-07 02:34:32 +02:00
parent ae79fd5e84
commit f432c8718c
3 changed files with 30 additions and 28 deletions

View File

@@ -240,7 +240,7 @@ func (g *RogueGame) dispatch(ch byte) {
g.Kamikaze = true
}
if !g.getDir() {
if !g.promptDirection() {
g.After = false
break
@@ -269,7 +269,7 @@ func (g *RogueGame) dispatch(ch byte) {
continue // the C goto over: fight by running at it
}
case 't':
if !g.getDir() {
if !g.promptDirection() {
g.After = false
} else {
g.missile(g.Delta.Y, g.Delta.X)
@@ -334,7 +334,7 @@ func (g *RogueGame) dispatch(ch byte) {
case 's':
g.search()
case 'z':
if g.getDir() {
if g.promptDirection() {
g.doZap()
} else {
g.After = false
@@ -360,7 +360,7 @@ func (g *RogueGame) dispatch(ch byte) {
g.After = false // "legal" illegal command
case '^':
g.After = false
if g.getDir() {
if g.promptDirection() {
g.Delta.Y += p.Pos.Y
g.Delta.X += p.Pos.X
@@ -386,7 +386,7 @@ func (g *RogueGame) dispatch(ch byte) {
g.Again = false
case 'm':
g.MoveOn = true
if !g.getDir() {
if !g.promptDirection() {
g.After = false
} else {
ch = g.DirCh

View File

@@ -406,9 +406,9 @@ func (g *RogueGame) isCurrent(obj *Object) bool {
return false
}
// getDir sets up the direction coordinate for use in various "prefix"
// commands (misc.c get_dir).
func (g *RogueGame) getDir() bool {
// promptDirection sets up the direction coordinate for use in various
// "prefix" commands (misc.c get_dir).
func (g *RogueGame) promptDirection() bool {
if g.Again && g.LastDir != 0 {
g.Delta = g.lastDelt
g.DirCh = g.LastDir