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

Fix searching items by itemtype #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vietlubu
Copy link

1. Cannot search item with itemtype is Healing

File: modules/item/index.php
With Healing items $itemType value is 0.
Is mean if ($itemType && $itemType !== '-1') allways false with Healing items selected.
We can use if ($itemType > -1). But I keep same style with checker $equipLocs line 103

@@ -55,7 +55,7 @@
			$bind[]      = $itemName;
		}
-		if ($itemType && $itemType !== '-1') {
+		if ($itemType !== false && $itemType !== '-1') {
			if (count($itemTypeSplit = explode('-', $itemType)) == 2) {

2. Cannot search item with itemtype is subtype

File: modules/item/index.php
Currently, FluxCP check view_sprite for subtype is incorrect.

@@ -72,10 +72,10 @@
				if (count($itemTypeSplit) == 2 && is_numeric($itemType2) && (floatval($itemType2) == intval($itemType2))) {
					$itemTypes2 = Flux::config('ItemTypes2')->toArray();
					if (array_key_exists($itemType, $itemTypes2) && array_key_exists($itemType2, $itemTypes2[$itemType]) && $itemTypes2[$itemType][$itemType2]) {
-						$sqlpartial .= "AND view_sprite = ? ";
+						$sqlpartial .= "AND subtype = ? ";
						$bind[]      = $itemType2;
					} else {
-						$sqlpartial .= 'AND view_sprite IS NULL ';
+						$sqlpartial .= 'AND subtype IS NULL ';
					}
				}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant