Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkwall #2282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Checkwall #2282

wants to merge 2 commits into from

Conversation

bWolfie
Copy link
Contributor

@bWolfie bWolfie commented Oct 12, 2018

Pull Request Prelude

Changes Proposed

  1. Adds the checkwall() script command, which will return if wall exists. Needed for scripts which attempt to delete non-existent walls.
  2. Adds the new checkwall() to agit_main_se script, which attempts to delete a non-existent wall when War of Emperium starts.

Affected Branches:

  • master
  • stable

Issues addressed:

#2119

Known Issues and TODO List

None known.

@HerculesWSAPI
Copy link
Contributor

This change is Reviewable

src/map/script.c Outdated
{
const char *name = script_getstr(st, 2);

if (((struct iwall_data *)strdb_get(map->iwall_db, name)) == NULL)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think better use strdb_exists for check is wall present or not

@dastgirp
Copy link
Member

Similar to #2150, except that this one has script edits

@bWolfie
Copy link
Contributor Author

bWolfie commented Oct 15, 2018

Similar to #2150, except that this one has script edits

Can you put the script edit into yours? It's necessary to stop console spam due to the delwall now sending warnings/debugs.

@Helianthella
Copy link
Member

it might be better to have a getwallinfo("<name>", <info>) command instead so it's more versatile

*getwallinfo("<name>", <info>)

Returns info on a wall created by setwall().

<info> can be:
WALLINFO_MAP        map name
WALLINFO_X          X axis location
WALLINFO_Y          Y axis location
WALLINFO_DIR        direction
WALLINFO_SHOOTABLE  whether or not it's shootable

And then to check if a wall exists you could do getwallinfo("name", WALLINFO_MAP) != ""

@Emistry
Copy link
Member

Emistry commented Oct 19, 2018

<info> can be:
WALLINFO_MAP        map name
WALLINFO_X          X axis location
WALLINFO_Y          Y axis location
WALLINFO_DIR        direction
WALLINFO_SHOOTABLE  whether or not it's shootable

Dont forget WALLINFO_SIZE too, to return the size of the wall

@Emistry Emistry added component:scripts Affecting the scripts and NPCs component:core:scriptengine Affecting the script engine or the script commands component:documentation Affecting the documentation in the doc/ folder labels Oct 19, 2018
@Emistry Emistry mentioned this pull request Jan 13, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:core:scriptengine Affecting the script engine or the script commands component:documentation Affecting the documentation in the doc/ folder component:scripts Affecting the scripts and NPCs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants