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

Elevates InvalidIndexOperation pragma to an error. #6653

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__pragmas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma InvalidOverride error
#pragma DanglingVarType error
#pragma MissingInterpolatedExpression error
#pragma InvalidIndexOperation error

//3000-3999
#pragma EmptyBlock error
3 changes: 2 additions & 1 deletion code/datums/components/_component.dm
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@
var/datum/component/C = dc[c_type]
if(C)
if(length(C))
C = C[1]
var/list/component_list = C
C = component_list[1]
if(C.type == c_type)
return C
return null
Expand Down
3 changes: 2 additions & 1 deletion code/game/machinery/vending/cm_vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1307,7 +1307,8 @@ GLOBAL_LIST_INIT(cm_vending_gear_corresponding_types_list, list(
var/obj/item/item_ref = myprod[3]
var/priority = myprod[priority_index]
if(islist(item_ref)) // multi-vending
item_ref = item_ref[1]
var/list/ref_list = item_ref
item_ref = ref_list[1]

var/is_category = item_ref == null

Expand Down
5 changes: 3 additions & 2 deletions code/modules/admin/view_variables/debug_variables.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
var/header
if(D)
if(islist(D))
var/list/var_list = D
var/index = name
if (value)
name = D[name] //name is really the index until this line
name = var_list[name] //name is really the index until this line
else
value = D[name]
value = var_list[name]
header = "<li style='backgroundColor:white'>[VV_HREF_TARGET_1V(D, VV_HK_LIST_EDIT, "E", index)][VV_HREF_TARGET_1V(D, VV_HK_LIST_CHANGE, "C", index)][VV_HREF_TARGET_1V(D, VV_HK_LIST_REMOVE, "-", index)] "
else
header = "<li style='backgroundColor:white'>[VV_HREF_TARGET_1V(D, VV_HK_BASIC_EDIT, "E", name)][VV_HREF_TARGET_1V(D, VV_HK_BASIC_CHANGE, "C", name)][VV_HREF_TARGET_1V(D, VV_HK_BASIC_MASSEDIT, "M", name)] "
Expand Down
3 changes: 3 additions & 0 deletions code/modules/paperwork/notepad.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@
else
to_chat(usr, SPAN_NOTICE("You need to hold it in your hands!"))

/obj/item/notepad/proc/operator[](index_num)
return contents[index_num]

/obj/item/notepad/verb/rename()
set name = "Rename notepad"
set category = "Object"
Expand Down
3 changes: 3 additions & 0 deletions code/modules/paperwork/paper_bundle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@
else
to_chat(usr, SPAN_NOTICE("You need to hold it in your hands!"))

/obj/item/paper_bundle/proc/operator[](index_num)
return contents[index_num]

/obj/item/paper_bundle/verb/rename()
set name = "Rename bundle"
set category = "Object"
Expand Down
Loading