FINALLY figured out how to rotate to face a square, thanks to all the help from Twitch chat. I need to study Trig.
This commit is contained in:
parent
d822cb3438
commit
9faad5f263
5 changed files with 85 additions and 11 deletions
|
@ -135,6 +135,11 @@ bool Autowalker::path_player(Pathing& paths, Point& target_out) {
|
|||
|
||||
void Autowalker::rotate_player(Point target) {
|
||||
auto player = GameDB::player_position();
|
||||
if(target == player.location) {
|
||||
dbc::log("!!!!!!!!!!!! maybe this is wrong");
|
||||
return;
|
||||
}
|
||||
|
||||
auto dir = System::shortest_rotate(player.location, player.aiming_at, target);
|
||||
|
||||
while(rayview->aiming_at != target) {
|
||||
|
@ -180,7 +185,7 @@ void Autowalker::handle_player_walk(ai::State& start, ai::State& goal) {
|
|||
start = update_state(start);
|
||||
auto a_plan = ai::plan("Host::actions", start, goal);
|
||||
auto action = a_plan.script.front();
|
||||
ai::dump_script("AUTOWALK", start, a_plan.script);
|
||||
// ai::dump_script("AUTOWALK", start, a_plan.script);
|
||||
|
||||
if(action.name == "find_enemy") {
|
||||
status(L"FINDING ENEMY");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue